Spaces:
Running
Running
stream?
Browse files
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
|
35 |
-
result +=
|
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?",
|