mirror of
https://github.com/ollama/ollama-python.git
synced 2026-01-13 21:57:16 +08:00
21 lines
370 B
Python
21 lines
370 B
Python
import sys
|
|
|
|
from ollama import create
|
|
|
|
|
|
args = sys.argv[1:]
|
|
if len(args) == 2:
|
|
# create from local file
|
|
path = args[1]
|
|
else:
|
|
print('usage: python main.py <name> <filepath>')
|
|
sys.exit(1)
|
|
|
|
# TODO: update to real Modelfile values
|
|
modelfile = f"""
|
|
FROM {path}
|
|
"""
|
|
|
|
for response in create(model=args[0], modelfile=modelfile, stream=True):
|
|
print(response['status'])
|