Kajise commited on
Commit
5852b73
1 Parent(s): 4389e80

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -9
app.py CHANGED
@@ -14,13 +14,12 @@ headers = {
14
  "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36"
15
  }
16
 
17
- hf_hub_download(repo_id="LLukas22/gpt4all-lora-quantized-ggjt", filename="ggjt-model.bin", local_dir=".")
18
- llm = Llama(model_path="./ggjt-model.bin", n_ctx=640)
19
 
20
- ins = '''### Instruction:
21
- {question}
22
- {data}
23
- ### Response:
24
  '''
25
 
26
  theme = gr.themes.Monochrome(
@@ -53,11 +52,12 @@ def search_ddg(question: str):
53
  return output_string
54
 
55
  def generate(instruction):
56
- feeding_data = "\n" + search_ddg(instruction)
57
- prompt = ins.format(question=instruction, data=feeding_data)
 
58
  print(prompt)
59
 
60
- response = llm(prompt, stop=['### Instruction:', '### End'])
61
  result = response['choices'][0]['text']
62
  return result
63
 
 
14
  "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36"
15
  }
16
 
17
+ hf_hub_download(repo_id="TheBloke/dolphin-2.5-mixtral-8x7b-GGUF", filename="dolphin-2.5-mixtral-8x7b.Q2_K.gguf", local_dir=".")
18
+ llm = Llama(model_path="./dolphin-2.5-mixtral-8x7b.Q2_K.gguf")
19
 
20
+ ins = '''<|im_start|>user
21
+ {question}<|im_end|>
22
+ <|im_start|>assistant
 
23
  '''
24
 
25
  theme = gr.themes.Monochrome(
 
52
  return output_string
53
 
54
  def generate(instruction):
55
+ # feeding_data = "\n" + search_ddg(instruction)
56
+ # prompt = ins.format(question=instruction, data=feeding_data)
57
+ prompt = ins.format(question=instruction)
58
  print(prompt)
59
 
60
+ response = llm(prompt, stop=['<|im_start|>user', '<|im_end|>'])
61
  result = response['choices'][0]['text']
62
  return result
63