vilarin commited on
Commit
29c0142
1 Parent(s): ffe6c17

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -22,8 +22,8 @@ subprocess.run("~/ollama pull gemma2", shell=True)
22
 
23
  import copy
24
  import gradio as gr
25
- import ollama
26
-
27
 
28
  HF_TOKEN = os.environ.get("HF_TOKEN", None)
29
  MODEL_ID = os.environ.get("MODEL_ID", "google/gemma-2-9b-it")
@@ -65,7 +65,7 @@ def stream_chat(message: str, history: list, temperature: float, context_window:
65
 
66
  print(f"Conversation is -\n{conversation}")
67
 
68
- response = ollama.chat(
69
  model="gemma2",
70
  messages=conversation,
71
  stream=True
 
22
 
23
  import copy
24
  import gradio as gr
25
+ from ollama import Client
26
+ client = Client(host='http://localhost:11434', timeout=60)
27
 
28
  HF_TOKEN = os.environ.get("HF_TOKEN", None)
29
  MODEL_ID = os.environ.get("MODEL_ID", "google/gemma-2-9b-it")
 
65
 
66
  print(f"Conversation is -\n{conversation}")
67
 
68
+ response = client.chat(
69
  model="gemma2",
70
  messages=conversation,
71
  stream=True