isaiah08 commited on
Commit
e263007
·
1 Parent(s): c12bfda

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -0
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()