Spaces:
Runtime error
Runtime error
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from transformers import pipeline
|
3 |
+
def text_generation_model(input_text):
|
4 |
+
model = pipeline("text-generation", model="facebook/galactica-6.7b")
|
5 |
+
output_text = model(input_text)
|
6 |
+
return output_text
|
7 |
+
|
8 |
+
input_text_interface = gr.inputs.Textbox(placeholder="Enter text here")
|
9 |
+
output_text_interface = gr.outputs.Textbox()
|
10 |
+
|
11 |
+
interface = gr.Interface(fn=text_generation_model, inputs=input_text_interface, outputs=output_text_interface, title="Text Generation Model")
|
12 |
+
|
13 |
+
interface.launch()
|