-
Notifications
You must be signed in to change notification settings - Fork 489
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #52 from ollama/mxyng/create-example
create example
- Loading branch information
Showing
1 changed file
with
20 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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']) |