Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,12 +1,17 @@
|
|
1 |
import gradio as gr
|
2 |
from llama_cpp import Llama
|
3 |
|
4 |
-
|
5 |
|
6 |
-
llm = Llama(
|
|
|
|
|
|
|
|
|
|
|
7 |
|
8 |
def chat(prompt):
|
9 |
response = llm(prompt, max_tokens=512, temperature=0.7)
|
10 |
return response["choices"][0]["text"]
|
11 |
|
12 |
-
gr.Interface(fn=chat, inputs="text", outputs="text", title="MegaBeam Mistral 512K - GGUF").launch()
|
|
|
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="model.gguf",
|
8 |
+
filename=MODEL_URL,
|
9 |
+
n_ctx=8192,
|
10 |
+
n_threads=4
|
11 |
+
)
|
12 |
|
13 |
def chat(prompt):
|
14 |
response = llm(prompt, max_tokens=512, temperature=0.7)
|
15 |
return response["choices"][0]["text"]
|
16 |
|
17 |
+
gr.Interface(fn=chat, inputs="text", outputs="text", title="MegaBeam Mistral 512K - GGUF").launch()
|