Kajise Org commited on
Commit
df95c95
1 Parent(s): 5d6831b

Replace base_prompt property to instruction

Browse files
Files changed (1) hide show
  1. app.py +8 -8
app.py CHANGED
@@ -7,6 +7,13 @@ from gradio.themes.utils import colors, fonts, sizes
7
  from llama_cpp import Llama
8
  from huggingface_hub import hf_hub_download
9
 
 
 
 
 
 
 
 
10
  hf_hub_download(repo_id="LLukas22/gpt4all-lora-quantized-ggjt", filename="ggjt-model.bin", local_dir=".")
11
  llm = Llama(model_path="./ggjt-model.bin")
12
 
@@ -16,13 +23,6 @@ ins = '''### Instruction:
16
  ### Response:
17
  '''
18
 
19
- import requests
20
- from bs4 import BeautifulSoup
21
-
22
- headers = {
23
- "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"
24
- }
25
-
26
  theme = gr.themes.Monochrome(
27
  primary_hue="purple",
28
  secondary_hue="red",
@@ -55,7 +55,7 @@ def search_ddg(question: str):
55
  def generate(instruction):
56
  feeding_data = search_ddg("What is KOIT-FM?")
57
 
58
- response = llm(ins.format(question=base_prompt, data=feeding_data), stop=['### Instruction:', '### End'])
59
  result = response['choices'][0]['text']
60
  return result
61
 
 
7
  from llama_cpp import Llama
8
  from huggingface_hub import hf_hub_download
9
 
10
+ import requests
11
+ from bs4 import BeautifulSoup
12
+
13
+ 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")
19
 
 
23
  ### Response:
24
  '''
25
 
 
 
 
 
 
 
 
26
  theme = gr.themes.Monochrome(
27
  primary_hue="purple",
28
  secondary_hue="red",
 
55
  def generate(instruction):
56
  feeding_data = search_ddg("What is KOIT-FM?")
57
 
58
+ response = llm(ins.format(question=instruction, data=feeding_data), stop=['### Instruction:', '### End'])
59
  result = response['choices'][0]['text']
60
  return result
61