Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
8 changes: 4 additions & 4 deletions operate/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,15 @@ def initialize_google(self):
def initialize_ollama(self):
if self.ollama_host:
if self.verbose:
print("[Config][initialize_ollama] using cached ollama host")
print("[Config][initialize_ollama] using ollama host", self.ollama_host)
else:
if self.verbose:
print(
"[Config][initialize_ollama] no cached ollama host. Assuming ollama running locally."
)
self.ollama_host = os.getenv("OLLAMA_HOST", None)
model = Client(host=self.ollama_host)
return model
self.ollama_host = os.getenv("OLLAMA_HOST", "http://localhost:11434")
client = Client(host=self.ollama_host)
return client

def initialize_anthropic(self):
if self.anthropic_api_key:
Expand Down
4 changes: 2 additions & 2 deletions operate/models/apis.py
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ def call_ollama_llava(messages):
print("[call_ollama_llava]")
time.sleep(1)
try:
model = config.initialize_ollama()
client = config.initialize_ollama()
screenshots_dir = "screenshots"
if not os.path.exists(screenshots_dir):
os.makedirs(screenshots_dir)
Expand All @@ -590,7 +590,7 @@ def call_ollama_llava(messages):
}
messages.append(vision_message)

response = model.chat(
response = client.chat(
model="llava",
messages=messages,
)
Expand Down