Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,20 +1,21 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
from llama_cpp import Llama
|
| 3 |
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
|
|
|
| 18 |
|
| 19 |
def response(message, history):
|
| 20 |
print(message)
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
from llama_cpp import Llama
|
| 3 |
|
| 4 |
+
try:
|
| 5 |
+
llm = Llama.from_pretrained(
|
| 6 |
+
repo_id="operablepattern/gemma-2b-it-Q",
|
| 7 |
+
filename="*Q5_K_M.gguf",
|
| 8 |
+
chat_format="gemma",
|
| 9 |
+
max_tokens=32,
|
| 10 |
+
verbose=True
|
| 11 |
+
)
|
| 12 |
+
except:
|
| 13 |
+
llm = Llama(
|
| 14 |
+
model_path="./gemma-2b-it-Q5_K_M.gguf",
|
| 15 |
+
chat_format="gemma",
|
| 16 |
+
max_tokens=32,
|
| 17 |
+
verbose=True
|
| 18 |
+
)
|
| 19 |
|
| 20 |
def response(message, history):
|
| 21 |
print(message)
|