Skip to content

Commit

Permalink
Merge pull request #52 from ollama/mxyng/create-example
Browse files Browse the repository at this point in the history
create example
  • Loading branch information
mxyng authored Feb 2, 2024
2 parents cdec2ad + c74dd58 commit eee32dd
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions examples/create/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
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'])

0 comments on commit eee32dd

Please sign in to comment.