sam2ai commited on
Commit
276fca0
1 Parent(s): 14819fe

inference model

Browse files
Files changed (2) hide show
  1. app.py +2 -2
  2. ggml-model-q4_0.bin +3 -0
app.py CHANGED
@@ -1,10 +1,10 @@
1
  import gradio as gr
2
  from llama_cpp import Llama
3
 
4
- llm = Llama(model_path="ggml-alpaca-7b-q4.bin", n_ctx=256, n_batch=128)
5
 
6
  def generate_text(input_text):
7
- output = llm(f"{input_text}", max_tokens=128, stop=["Q:", "\n", "#"], echo=False)
8
  return output['choices'][0]['text']
9
 
10
  input_text = gr.inputs.Textbox(lines= 10, label="Enter your input text")
 
1
  import gradio as gr
2
  from llama_cpp import Llama
3
 
4
+ llm = Llama(model_path="ggml-model-q4_0.bin")
5
 
6
  def generate_text(input_text):
7
+ output = llm(f"### Instruction:\n{input_text}\n\n### Response:\n", max_tokens=256, echo=False)
8
  return output['choices'][0]['text']
9
 
10
  input_text = gr.inputs.Textbox(lines= 10, label="Enter your input text")
ggml-model-q4_0.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:84905e755a89828b935fc0f1031a28bc2199c7710095fe3dbe64e8afee5f187b
3
+ size 3791725184