mirror of
https://github.com/ollama/ollama-python.git
synced 2026-01-14 06:07:17 +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):
|
for line in io.StringIO(modelfile):
|
||||||
command, _, args = line.partition(' ')
|
command, _, args = line.partition(' ')
|
||||||
if command.upper() in ['FROM', 'ADAPTER']:
|
if command.upper() in ['FROM', 'ADAPTER']:
|
||||||
path = Path(args).expanduser()
|
path = Path(args.strip()).expanduser()
|
||||||
path = path if path.is_absolute() else base / path
|
path = path if path.is_absolute() else base / path
|
||||||
if path.exists():
|
if path.exists():
|
||||||
args = f'@{self._create_blob(path)}'
|
args = f'@{self._create_blob(path)}'
|
||||||
@ -288,7 +288,7 @@ class Client(BaseClient):
|
|||||||
raise
|
raise
|
||||||
|
|
||||||
with open(path, 'rb') as r:
|
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
|
return digest
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user