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 |
+
|
4 |
+
# Load your model
|
5 |
+
model = pipeline("fill-mask", model="Phase-Technologies/RoBERTo")
|
6 |
+
|
7 |
+
# Define inference function
|
8 |
+
def predict(text):
|
9 |
+
return model(text)
|
10 |
+
|
11 |
+
# Create Gradio UI
|
12 |
+
iface = gr.Interface(fn=predict, inputs="text", outputs="json")
|
13 |
+
iface.launch()
|