Spaces:
Runtime error
Runtime error
File size: 688 Bytes
33f1413 7e2cdfb 33f1413 7e2cdfb 33f1413 7e2cdfb |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
import gradio as gr
from transformers import pipeline
# Load your pre-trained model from Hugging Face
model = pipeline("text-classification", model="your-username/your-model-repo")
# Define the prediction function
def predict(text):
return model(text)
# Create Gradio interface
interface = gr.Interface(
fn=predict, # The prediction function
inputs="text", # Input to your model (text, image, etc.)
outputs="label", # Output of your model (label, text, image, etc.)
title="My Model", # Title of the app
description="This app predicts the category of customer support requests.",
)
# Launch the interface
interface.launch()
|