disoreder-api / app.py
hasanmustafa0503's picture
Create app.py
f8d7b94 verified
raw
history blame contribute delete
422 Bytes
import gradio as gr
from transformers import pipeline
# Load the pre-trained model
model = pipeline("text-classification", model="hasanmustafa0503/DisorderDetectionModel")
# Define the inference function
def predict_disorder(text):
result = model(text)
return result
# Create a Gradio interface
interface = gr.Interface(fn=predict_disorder, inputs="text", outputs="json")
# Launch the app
interface.launch()