Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,17 +1,14 @@
|
|
1 |
-
import gradio as gr
|
2 |
from llama_cpp import Llama
|
3 |
-
|
4 |
-
MODEL_URL = "https://huggingface.co/bartowski/MegaBeam-Mistral-7B-512k-GGUF/resolve/main/MegaBeam-Mistral-7B-512k-Q4_K_M.gguf"
|
5 |
|
6 |
llm = Llama(
|
7 |
-
model_path="
|
8 |
-
filename=MODEL_URL,
|
9 |
n_ctx=8192,
|
10 |
n_threads=4
|
11 |
)
|
12 |
|
13 |
def chat(prompt):
|
14 |
-
|
15 |
-
return
|
16 |
|
17 |
-
gr.Interface(fn=chat, inputs="text", outputs="text", title="MegaBeam Mistral
|
|
|
|
|
1 |
from llama_cpp import Llama
|
2 |
+
import gradio as gr
|
|
|
3 |
|
4 |
llm = Llama(
|
5 |
+
model_path="https://huggingface.co/bartowski/MegaBeam-Mistral-7B-512k-GGUF/resolve/main/MegaBeam-Mistral-7B-512k-Q4_K_M.gguf",
|
|
|
6 |
n_ctx=8192,
|
7 |
n_threads=4
|
8 |
)
|
9 |
|
10 |
def chat(prompt):
|
11 |
+
output = llm(prompt, max_tokens=512, temperature=0.7)
|
12 |
+
return output["choices"][0]["text"]
|
13 |
|
14 |
+
gr.Interface(fn=chat, inputs="text", outputs="text", title="🧠 MegaBeam Mistral 512k Chatbot").launch()
|