Spaces:
Sleeping
Sleeping
Commit ·
933f185
1
Parent(s): 4e07e3b
add pipeline
Browse files
app.py
CHANGED
|
@@ -2,11 +2,11 @@ import gradio as gr
|
|
| 2 |
from transformers import pipeline
|
| 3 |
|
| 4 |
pipeline = pipeline("text-generation")
|
| 5 |
-
result = pipeline("the secret to baking a really good cake is ")
|
| 6 |
|
| 7 |
-
def
|
| 8 |
-
|
| 9 |
-
|
|
|
|
| 10 |
|
| 11 |
-
demo = gr.Interface(fn=
|
| 12 |
demo.launch()
|
|
|
|
| 2 |
from transformers import pipeline
|
| 3 |
|
| 4 |
pipeline = pipeline("text-generation")
|
|
|
|
| 5 |
|
| 6 |
+
def text_generate(input_text):
|
| 7 |
+
result = pipeline(input_text)
|
| 8 |
+
result = result[0]["generated_text"]
|
| 9 |
+
return result
|
| 10 |
|
| 11 |
+
demo = gr.Interface(fn=text_generate, inputs="text", outputs="text")
|
| 12 |
demo.launch()
|