Spaces:
Runtime error
Runtime error
Commit
•
f0fdf34
1
Parent(s):
b7a4f94
Update app.py
Browse files
app.py
CHANGED
@@ -1,15 +1,15 @@
|
|
1 |
import gradio as gr
|
2 |
from transformers import pipeline
|
3 |
|
4 |
-
generator = pipeline('text-generation', model='AlekseyKorshuk/
|
5 |
|
6 |
def generate(text):
|
7 |
-
result = generator(text,
|
8 |
return result[0]["generated_text"]
|
9 |
|
10 |
examples = [
|
11 |
-
["
|
12 |
-
["
|
13 |
]
|
14 |
|
15 |
demo = gr.Interface(
|
|
|
1 |
import gradio as gr
|
2 |
from transformers import pipeline
|
3 |
|
4 |
+
generator = pipeline('text-generation', model='AlekseyKorshuk/pythia-1.4b-deduped-jokes')
|
5 |
|
6 |
def generate(text):
|
7 |
+
result = generator(text, max_new_tokens=256, num_return_sequences=1, do_sample=True)
|
8 |
return result[0]["generated_text"]
|
9 |
|
10 |
examples = [
|
11 |
+
["Two guys walk into a bar."],
|
12 |
+
["Why was the musician arrested?"],
|
13 |
]
|
14 |
|
15 |
demo = gr.Interface(
|