Monster commited on
Commit
2351faf
1 Parent(s): 46c9998
Files changed (1) hide show
  1. app.py +12 -5
app.py CHANGED
@@ -27,14 +27,21 @@ theme = gr.themes.Monochrome(
27
 
28
 
29
 
 
 
 
 
 
 
 
 
30
  def generate(instruction):
31
- response = resp = 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
  examples = [
39
  "Instead of making a peanut butter and jelly sandwich, what else could I combine peanut butter with in a sandwich? Give five ideas",
40
  "How do I make a campfire?",
 
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), stream=True):
41
+ result += x
42
  yield result
43
+
44
+
45
  examples = [
46
  "Instead of making a peanut butter and jelly sandwich, what else could I combine peanut butter with in a sandwich? Give five ideas",
47
  "How do I make a campfire?",