mirror of
https://github.com/ollama/ollama-python.git
synced 2026-01-13 21:57:16 +08:00
fix: remote create new file
This commit is contained in:
parent
e0ee198195
commit
b232a6c04d
@ -262,7 +262,7 @@ class Client(BaseClient):
|
||||
for line in io.StringIO(modelfile):
|
||||
command, _, args = line.partition(' ')
|
||||
if command.upper() in ['FROM', 'ADAPTER']:
|
||||
path = Path(args).expanduser()
|
||||
path = Path(args.strip()).expanduser()
|
||||
path = path if path.is_absolute() else base / path
|
||||
if path.exists():
|
||||
args = f'@{self._create_blob(path)}'
|
||||
@ -288,7 +288,7 @@ class Client(BaseClient):
|
||||
raise
|
||||
|
||||
with open(path, 'rb') as r:
|
||||
self._request('PUT', f'/api/blobs/{digest}', content=r)
|
||||
self._request('POST', f'/api/blobs/{digest}', content=r)
|
||||
|
||||
return digest
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user