Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,13 @@
|
|
1 |
import gradio as gr
|
2 |
from gradio import mix
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
|
4 |
|
5 |
title = "Miniature"
|
@@ -16,7 +24,7 @@ io = gr.Interface.load("huggingface/keras-io/text-generation")
|
|
16 |
|
17 |
def inference(text):
|
18 |
|
19 |
-
return
|
20 |
|
21 |
|
22 |
|
|
|
1 |
import gradio as gr
|
2 |
from gradio import mix
|
3 |
+
from transformers import pipeline
|
4 |
+
|
5 |
+
generator = pipeline("text-generation", model="distilgpt2")
|
6 |
+
generator(
|
7 |
+
"In this course, we will teach you how to",
|
8 |
+
max_length=30,
|
9 |
+
num_return_sequences=2,
|
10 |
+
)
|
11 |
|
12 |
|
13 |
title = "Miniature"
|
|
|
24 |
|
25 |
def inference(text):
|
26 |
|
27 |
+
return generator(text)
|
28 |
|
29 |
|
30 |
|