File size: 447 Bytes
2e0abc7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import gradio as gr
from transformers import pipeline

# Load the model from Hugging Face
classifier = pipeline("text-classification", model="samyak152002/my-disease-classifier-sih")

# Define the prediction function
def predict(text):
    result = classifier(text)
    return result

# Set up the Gradio interface
interface = gr.Interface(fn=predict, inputs="text", outputs="json", title="Disease Classifier")

# Launch the app
interface.launch()