Spaces:
Sleeping
Sleeping
check
Browse files
main.py
CHANGED
|
@@ -2,13 +2,16 @@ from transformers import pipeline
|
|
| 2 |
|
| 3 |
import gradio as gr
|
| 4 |
|
| 5 |
-
pipe_flan = pipeline("text2text-generation", model="google/flan-t5-small")
|
| 6 |
|
| 7 |
|
| 8 |
def pred(input):
|
| 9 |
output = pipe_flan(input)
|
| 10 |
return output[0]["generated_text"]
|
| 11 |
|
|
|
|
|
|
|
|
|
|
| 12 |
|
| 13 |
demo = gr.Blocks()
|
| 14 |
|
|
@@ -18,7 +21,7 @@ with demo:
|
|
| 18 |
b1 = gr.Button('Submit')
|
| 19 |
output_text = gr.Textbox()
|
| 20 |
|
| 21 |
-
b1.click(fn =
|
| 22 |
|
| 23 |
if __name__=='__main__':
|
| 24 |
demo.launch()
|
|
|
|
| 2 |
|
| 3 |
import gradio as gr
|
| 4 |
|
| 5 |
+
# pipe_flan = pipeline("text2text-generation", model="google/flan-t5-small")
|
| 6 |
|
| 7 |
|
| 8 |
def pred(input):
|
| 9 |
output = pipe_flan(input)
|
| 10 |
return output[0]["generated_text"]
|
| 11 |
|
| 12 |
+
def test_fun(input):
|
| 13 |
+
return input
|
| 14 |
+
|
| 15 |
|
| 16 |
demo = gr.Blocks()
|
| 17 |
|
|
|
|
| 21 |
b1 = gr.Button('Submit')
|
| 22 |
output_text = gr.Textbox()
|
| 23 |
|
| 24 |
+
b1.click(fn = test_fun, inputs=input_text, outputs= output_text)
|
| 25 |
|
| 26 |
if __name__=='__main__':
|
| 27 |
demo.launch()
|