Fix --host argument
This commit is contained in:
parent
8deaa3b6e1
commit
a69b63e4fe
11
assistant.py
11
assistant.py
|
|
@ -88,8 +88,6 @@ def copy_string_to_clipboard(string):
|
|||
except:
|
||||
return
|
||||
|
||||
# Point to the local server
|
||||
client = Client(host=server)
|
||||
|
||||
code_history = []
|
||||
|
||||
|
|
@ -151,8 +149,8 @@ def parse_args():
|
|||
parser.add_argument('--model', '-m', nargs='?', const=True, default=False, help='Specify model')
|
||||
# Add the --temp (-t) argument
|
||||
parser.add_argument('--temp', '-t', nargs='?', const=True, default=False, help='Specify temperature')
|
||||
# Add the --host (-s) argument
|
||||
parser.add_argument('--h', '-h', nargs='1', const=True, default=False, help='Specify host of ollama server')
|
||||
# Add the --host (-h) argument
|
||||
parser.add_argument('--host', nargs='?', const=True, default=False, help='Specify host of ollama server')
|
||||
# Parse the arguments
|
||||
return parser.parse_args()
|
||||
|
||||
|
|
@ -210,10 +208,15 @@ def handle_non_piped_input(args):
|
|||
else:
|
||||
chat(user_input)
|
||||
|
||||
client = None
|
||||
|
||||
def main():
|
||||
args = parse_args()
|
||||
if args.host:
|
||||
set_host(args.host)
|
||||
# Point to the local server
|
||||
global client
|
||||
client = Client(host=server)
|
||||
if args.model:
|
||||
global model
|
||||
model = args.model
|
||||
|
|
|
|||
Loading…
Reference in a new issue