Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from transformers import pipeline
|
3 |
+
import tensorflow
|
4 |
+
|
5 |
+
text2text_generator = pipeline("text2text-generation")
|
6 |
+
|
7 |
+
def main(input):
|
8 |
+
return text2text_generator("question: " + input + " context: 42 is the answer to life, the universe and everything")
|
9 |
+
|
10 |
+
iface = gr.Interface(fn=main, inputs="text", outputs="text")
|
11 |
+
iface.launch()
|