From a69b63e4fe2ee587fb16cd5c2992cc79a315e812 Mon Sep 17 00:00:00 2001 From: Hayden Johnson Date: Wed, 25 Sep 2024 13:02:02 -0700 Subject: [PATCH] Fix --host argument --- assistant.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/assistant.py b/assistant.py index 48067b1..2bf5aa5 100755 --- a/assistant.py +++ b/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