asimsultan commited on
Commit
25cbcb4
·
verified ·
1 Parent(s): 323c958

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -3
app.py CHANGED
@@ -1,12 +1,17 @@
1
  import gradio as gr
2
  from llama_cpp import Llama
3
 
4
- MODEL_PATH = "model.gguf" # downloaded in advance
5
 
6
- llm = Llama(model_path=MODEL_PATH, n_ctx=8192, n_threads=4)
 
 
 
 
 
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()