Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -18,7 +18,7 @@ OLLAMA_SERVICE_THREAD.start()
|
|
18 |
|
19 |
print("Giving ollama serve a moment")
|
20 |
time.sleep(10)
|
21 |
-
|
22 |
|
23 |
|
24 |
import copy
|
@@ -33,16 +33,6 @@ HF_TOKEN = os.environ.get("HF_TOKEN", None)
|
|
33 |
MODEL_ID = "google/gemma-2-27b-it"
|
34 |
MODEL_NAME = MODEL_ID.split("/")[-1]
|
35 |
|
36 |
-
os.environ["HF_HUB_ENABLE_HF_TRANSFER"] = "1"
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
llm = Ollama(model="gemma2", request_timeout=60.0)
|
41 |
-
|
42 |
-
|
43 |
-
def run_ollama():
|
44 |
-
subprocess.run("~/ollama pull gemma2", shell=True)
|
45 |
-
|
46 |
TITLE = "<h1><center>Chatbox</center></h1>"
|
47 |
|
48 |
DESCRIPTION = f"""
|
@@ -82,7 +72,7 @@ def stream_chat(message: str, history: list, temperature: float, context_window:
|
|
82 |
|
83 |
print(f"Conversation is -\n{conversation}")
|
84 |
|
85 |
-
|
86 |
resp = llm.chat(
|
87 |
messages = messages,
|
88 |
chat_history = conversation,
|
|
|
18 |
|
19 |
print("Giving ollama serve a moment")
|
20 |
time.sleep(10)
|
21 |
+
subprocess.run("~/ollama run gemma2", shell=True)
|
22 |
|
23 |
|
24 |
import copy
|
|
|
33 |
MODEL_ID = "google/gemma-2-27b-it"
|
34 |
MODEL_NAME = MODEL_ID.split("/")[-1]
|
35 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
TITLE = "<h1><center>Chatbox</center></h1>"
|
37 |
|
38 |
DESCRIPTION = f"""
|
|
|
72 |
|
73 |
print(f"Conversation is -\n{conversation}")
|
74 |
|
75 |
+
llm = Ollama(model="gemma2", request_timeout=60.0)
|
76 |
resp = llm.chat(
|
77 |
messages = messages,
|
78 |
chat_history = conversation,
|