Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions transformerlab/models/ollamamodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,17 @@

import os
import json
import shutil
import errno
import sys


async def list_models():
try:
ollama_model_library = ollama_models_library_dir()
except FileNotFoundError:
print("Skipping Ollama models: manifests directory not found")
return []
except Exception as e:
print("Failed to locate Ollama models library:")
print(str(e))
Expand Down Expand Up @@ -219,6 +224,10 @@ def ollama_models_dir():
if not os.path.isdir(ollama_dir):
return None

if shutil.which("ollama") is not None:
print(f"OLLAMA_MODELS not set but 'ollama' CLI found; assuming default: {ollama_dir}", file=sys.stderr)
return ollama_dir

return ollama_dir


Expand Down
6 changes: 1 addition & 5 deletions transformerlab/routers/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -593,8 +593,6 @@ async def get_task_file_content(task_dir: str, file_path: str):
return {"status": "error", "message": "An error occurred while getting task file content"}




@router.post("/install_from_gallery", summary="Install a task from transformerlab/galleries to local tasks-gallery")
async def install_task_from_gallery(
id: str = Form(...),
Expand Down Expand Up @@ -932,9 +930,7 @@ async def import_task_from_local_gallery(
remote_info = resp.json()
# Extract uploaded_dir path from response
uploaded_dir = (
remote_info.get("uploaded_files", {})
.get("dir_files", {})
.get("uploaded_dir")
remote_info.get("uploaded_files", {}).get("dir_files", {}).get("uploaded_dir")
)
if uploaded_dir:
try:
Expand Down
Loading