ollama init to common utils
This commit is contained in:
@@ -7,27 +7,13 @@ app = marimo.App(width="medium")
|
||||
@app.cell
|
||||
def _():
|
||||
import marimo as mo
|
||||
import requests
|
||||
import ollama
|
||||
from ollama import Client
|
||||
from utils import connect_qumo_ollama
|
||||
|
||||
VM_NAME = 'hiperf-gpu'
|
||||
#VM_NAME = 'ollama-vb'
|
||||
# VM_NAME = 'hiperf-gpu'
|
||||
VM_NAME = 'ollama-lite'
|
||||
|
||||
QUMO_OLLAMA_URL = f'http://{VM_NAME}.tail44fa00.ts.net:11434'
|
||||
return Client, QUMO_OLLAMA_URL, mo, requests
|
||||
|
||||
|
||||
@app.cell
|
||||
def _(Client, QUMO_OLLAMA_URL, requests):
|
||||
try:
|
||||
requests.get(QUMO_OLLAMA_URL, timeout=5)
|
||||
client = Client(
|
||||
host=QUMO_OLLAMA_URL
|
||||
)
|
||||
except requests.ConnectionError:
|
||||
print(f"Failed to reach {QUMO_OLLAMA_URL}. Check that the VM is running and Tailscale is up")
|
||||
return
|
||||
client = connect_qumo_ollama(VM_NAME)
|
||||
return (mo,)
|
||||
|
||||
|
||||
@app.cell(hide_code=True)
|
||||
|
||||
Reference in New Issue
Block a user