Spaces:
Runtime error
Runtime error
Commit
Β·
d75f5ef
1
Parent(s):
3ab0fd6
add more examples
Browse files
app.py
CHANGED
|
@@ -21,25 +21,26 @@ generate_text = InstructionTextGenerationPipeline(model=model, tokenizer=tokeniz
|
|
| 21 |
|
| 22 |
def generate(instruction):
|
| 23 |
response = generate_text(instruction)
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
|
|
|
| 27 |
# yield result
|
| 28 |
return response
|
| 29 |
|
| 30 |
examples = [
|
| 31 |
"Instead of making a peanut butter and jelly sandwich, what else could I combine peanut butter with in a sandwich? Give five ideas",
|
| 32 |
"How do I make a campfire?",
|
| 33 |
-
"Write me a tweet about the release of Dolly 2.0, a new LLM"
|
| 34 |
-
|
|
|
|
| 35 |
]
|
| 36 |
|
| 37 |
-
|
| 38 |
def process_example(args):
|
| 39 |
for x in generate(args):
|
| 40 |
pass
|
| 41 |
return x
|
| 42 |
-
|
| 43 |
css = ".generating {visibility: hidden}"
|
| 44 |
|
| 45 |
with gr.Blocks(theme=theme, analytics_enabled=False, css=css) as demo:
|
|
|
|
| 21 |
|
| 22 |
def generate(instruction):
|
| 23 |
response = generate_text(instruction)
|
| 24 |
+
result = ""
|
| 25 |
+
for word in response.split(" "):
|
| 26 |
+
result += word + " "
|
| 27 |
+
print(result)
|
| 28 |
# yield result
|
| 29 |
return response
|
| 30 |
|
| 31 |
examples = [
|
| 32 |
"Instead of making a peanut butter and jelly sandwich, what else could I combine peanut butter with in a sandwich? Give five ideas",
|
| 33 |
"How do I make a campfire?",
|
| 34 |
+
"Write me a tweet about the release of Dolly 2.0, a new LLM",
|
| 35 |
+
"Explain to me the difference between nuclear fission and fusion.",
|
| 36 |
+
"I'm selling my Nikon D-750, write a short blurb for my ad."
|
| 37 |
]
|
| 38 |
|
|
|
|
| 39 |
def process_example(args):
|
| 40 |
for x in generate(args):
|
| 41 |
pass
|
| 42 |
return x
|
| 43 |
+
|
| 44 |
css = ".generating {visibility: hidden}"
|
| 45 |
|
| 46 |
with gr.Blocks(theme=theme, analytics_enabled=False, css=css) as demo:
|