Spaces:
Runtime error
Runtime error
Commit
·
c6144cf
1
Parent(s):
8035b1b
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,8 +1,13 @@
|
|
| 1 |
import os
|
| 2 |
import gradio as gr
|
| 3 |
import numpy as np
|
|
|
|
| 4 |
|
|
|
|
| 5 |
|
| 6 |
-
|
|
|
|
|
|
|
| 7 |
|
|
|
|
| 8 |
io.launch()
|
|
|
|
| 1 |
import os
|
| 2 |
import gradio as gr
|
| 3 |
import numpy as np
|
| 4 |
+
from transformers import pipeline
|
| 5 |
|
| 6 |
+
pipe = pipeline("text2text-generation", model="google/flan-t5-large")
|
| 7 |
|
| 8 |
+
def inference(text):
|
| 9 |
+
output = pipe(text)
|
| 10 |
+
return output["generated_text"]
|
| 11 |
|
| 12 |
+
io = gr.Interface.load(inference, gr.Textbox(lines=3), gr.Textbox(lines=3))
|
| 13 |
io.launch()
|