-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheck_models.py
More file actions
33 lines (28 loc) · 1.03 KB
/
check_models.py
File metadata and controls
33 lines (28 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import ollama
try:
client = ollama.Client()
models = "gemma3:1b-it-qat"
print("Available Ollama models:")
print("-" * 30)
# Handle different response formats
if isinstance(models, dict):
if 'models' in models:
for model in models['models']:
# Try different possible keys
if isinstance(model, dict):
name = model.get('name', model.get('model', 'Unknown'))
print(f" {name}")
else:
print(f" {model}")
else:
print("Response format:", models)
else:
print("Unexpected response type:", type(models))
print("\nTo use a model, update the 'model' variable in app_simple.py")
print("For example: model = 'llama2' or model = 'mistral'")
except Exception as e:
print(f"Error connecting to Ollama: {e}")
print("\nMake sure Ollama is running:")
print(" ollama serve")
print("\nThen pull a model:")
print(" ollama pull llama2")