Compare commits
No commits in common. "a69b63e4fe2ee587fb16cd5c2992cc79a315e812" and "f454e9e17b70803cbbbdb4437d0ae9eaaa3675d9" have entirely different histories.
a69b63e4fe
...
f454e9e17b
16
assistant.py
16
assistant.py
|
|
@ -10,7 +10,6 @@ from pygments.lexers import get_lexer_by_name
|
||||||
from pygments.formatters import TerminalFormatter
|
from pygments.formatters import TerminalFormatter
|
||||||
|
|
||||||
|
|
||||||
server = 'localhost:11434'
|
|
||||||
model = 'llama3.1:8b-instruct-q8_0'
|
model = 'llama3.1:8b-instruct-q8_0'
|
||||||
temp = 0.2
|
temp = 0.2
|
||||||
|
|
||||||
|
|
@ -88,6 +87,8 @@ def copy_string_to_clipboard(string):
|
||||||
except:
|
except:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
# Point to the local server
|
||||||
|
client = Client(host='localhost:11434')
|
||||||
|
|
||||||
code_history = []
|
code_history = []
|
||||||
|
|
||||||
|
|
@ -149,15 +150,9 @@ def parse_args():
|
||||||
parser.add_argument('--model', '-m', nargs='?', const=True, default=False, help='Specify model')
|
parser.add_argument('--model', '-m', nargs='?', const=True, default=False, help='Specify model')
|
||||||
# Add the --temp (-t) argument
|
# Add the --temp (-t) argument
|
||||||
parser.add_argument('--temp', '-t', nargs='?', const=True, default=False, help='Specify temperature')
|
parser.add_argument('--temp', '-t', nargs='?', const=True, default=False, help='Specify temperature')
|
||||||
# Add the --host (-h) argument
|
|
||||||
parser.add_argument('--host', nargs='?', const=True, default=False, help='Specify host of ollama server')
|
|
||||||
# Parse the arguments
|
# Parse the arguments
|
||||||
return parser.parse_args()
|
return parser.parse_args()
|
||||||
|
|
||||||
def set_host(host):
|
|
||||||
global server
|
|
||||||
server = host
|
|
||||||
|
|
||||||
def arg_follow_up(args):
|
def arg_follow_up(args):
|
||||||
sys.stdin = open('/dev/tty')
|
sys.stdin = open('/dev/tty')
|
||||||
if args.follow_up != True:
|
if args.follow_up != True:
|
||||||
|
|
@ -208,15 +203,8 @@ def handle_non_piped_input(args):
|
||||||
else:
|
else:
|
||||||
chat(user_input)
|
chat(user_input)
|
||||||
|
|
||||||
client = None
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
args = parse_args()
|
args = parse_args()
|
||||||
if args.host:
|
|
||||||
set_host(args.host)
|
|
||||||
# Point to the local server
|
|
||||||
global client
|
|
||||||
client = Client(host=server)
|
|
||||||
if args.model:
|
if args.model:
|
||||||
global model
|
global model
|
||||||
model = args.model
|
model = args.model
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue