indenting
This commit is contained in:
parent
aa38ad5b3f
commit
1db3402d0c
@ -3,12 +3,12 @@ import sys
|
||||
from argparse import ArgumentParser
|
||||
import ollama
|
||||
|
||||
default_model = 'llama3.1'
|
||||
client_url = os.getenv('OLLAMA_HOST')
|
||||
if client_url is None:
|
||||
# lookup config file
|
||||
if client_url is None:
|
||||
client_url = '0.0.0.0' # localhost
|
||||
default_model = 'llama3.1'
|
||||
|
||||
parser = ArgumentParser('ollama-ask', description='Ollama CLI options')
|
||||
parser.add_argument('-m', '--model', default=default_model, help='Specify ollama model')
|
||||
@ -27,12 +27,7 @@ def cli():
|
||||
|
||||
def run(host, model, question):
|
||||
client = ollama.Client(host=host)
|
||||
messages = [
|
||||
{
|
||||
'role': 'user',
|
||||
'content': question,
|
||||
},
|
||||
]
|
||||
messages = [{ 'role': 'user', 'content': question }]
|
||||
|
||||
try:
|
||||
for part in client.chat(model=model, messages=messages, stream=True):
|
||||
|
Loading…
x
Reference in New Issue
Block a user