Mahesh1909 commited on
Commit
2d99ad3
·
verified ·
1 Parent(s): 57f3b86

Create mobileprice

Browse files
Files changed (1) hide show
  1. 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()