Skip to content

Commit b232a6c

Browse files
committed
fix: remote create new file
1 parent e0ee198 commit b232a6c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ollama/_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ def _parse_modelfile(self, modelfile: str, base: Optional[Path] = None) -> str:
262262
for line in io.StringIO(modelfile):
263263
command, _, args = line.partition(' ')
264264
if command.upper() in ['FROM', 'ADAPTER']:
265-
path = Path(args).expanduser()
265+
path = Path(args.strip()).expanduser()
266266
path = path if path.is_absolute() else base / path
267267
if path.exists():
268268
args = f'@{self._create_blob(path)}'
@@ -288,7 +288,7 @@ def _create_blob(self, path: Union[str, Path]) -> str:
288288
raise
289289

290290
with open(path, 'rb') as r:
291-
self._request('PUT', f'/api/blobs/{digest}', content=r)
291+
self._request('POST', f'/api/blobs/{digest}', content=r)
292292

293293
return digest
294294

0 commit comments

Comments
 (0)