45 lines
962 B
Python
45 lines
962 B
Python
import marimo
|
|
|
|
__generated_with = "0.18.0"
|
|
app = marimo.App(width="medium")
|
|
|
|
|
|
@app.cell
|
|
def _():
|
|
import marimo as mo
|
|
import requests
|
|
import ollama
|
|
from ollama import Client
|
|
|
|
VM_NAME = 'hiperf-gpu'
|
|
#VM_NAME = 'ollama-vb'
|
|
|
|
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
|
|
|
|
|
|
@app.cell(hide_code=True)
|
|
def _(mo):
|
|
mo.md(r"""
|
|
# Examples:
|
|
|
|
[Quick and Easy: Sentiment Analysis with LLM](https://medium.com/@beam_villa/quick-and-easy-sentiment-analysis-with-llm-c61c562d059c)
|
|
""")
|
|
return
|
|
|
|
|
|
if __name__ == "__main__":
|
|
app.run()
|