Spaces:
Runtime error
Runtime error
Create mobileprice
Browse files- mobileprice +16 -0
mobileprice
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
import torch
|
| 3 |
+
from transformers import pipeline
|
| 4 |
+
|
| 5 |
+
# Load your trained Hugging Face model
|
| 6 |
+
model = pipeline("text-classification", model="your-huggingface-model")
|
| 7 |
+
|
| 8 |
+
# Define the function that processes input and returns predictions
|
| 9 |
+
def predict(text):
|
| 10 |
+
return model(text)
|
| 11 |
+
|
| 12 |
+
# Create Gradio interface
|
| 13 |
+
iface = gr.Interface(fn=predict, inputs="text", outputs="label")
|
| 14 |
+
|
| 15 |
+
# Launch the Gradio app
|
| 16 |
+
iface.launch()
|