Whalb commited on
Commit
54ac8f2
·
1 Parent(s): 55606d0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -16
app.py CHANGED
@@ -10,7 +10,6 @@ from huggingface_hub import hf_hub_download
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
 
13
-
14
  ins = '''### Instruction:
15
  {}
16
  ### Response:
@@ -24,22 +23,10 @@ theme = gr.themes.Monochrome(
24
  font=[gr.themes.GoogleFont("Open Sans"), "ui-sans-serif", "system-ui", "sans-serif"],
25
  )
26
 
27
-
28
-
29
-
30
- # def generate(instruction):
31
- # response = llm(ins.format(instruction))
32
- # response = response['choices'][0]['text']
33
- # result = ""
34
- # for word in response.split(" "):
35
- # result += word + " "
36
- # yield result
37
-
38
  def generate(instruction):
39
- result = ""
40
- for x in llm(ins.format(instruction), stop=['### Instruction:', '### End'], stream=True):
41
- result += x['choices'][0]['text']
42
- yield result
43
 
44
 
45
  examples = [
 
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
 
 
13
  ins = '''### Instruction:
14
  {}
15
  ### Response:
 
23
  font=[gr.themes.GoogleFont("Open Sans"), "ui-sans-serif", "system-ui", "sans-serif"],
24
  )
25
 
 
 
 
 
 
 
 
 
 
 
 
26
  def generate(instruction):
27
+ response = llm(ins.format(instruction), stop=['### Instruction:', '### End'])
28
+ result = response['choices'][0]['text']
29
+ return result
 
30
 
31
 
32
  examples = [