asimsultan commited on
Commit
74d5309
·
verified ·
1 Parent(s): 25cbcb4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -8
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="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()
 
 
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()