Spaces:
No application file
No application file
import gradio as gr | |
import joblib # Replace with your model loading library | |
# Load pre-trained model | |
model = joblib.load("diagnostic_model.pkl") | |
# Define the prediction function | |
def predict_disease(symptoms): | |
prediction = model.predict([symptoms])[0] | |
return f"Predicted Diagnosis: {prediction}" | |
# Create the Gradio interface | |
interface = gr.Interface( | |
fn=predict_disease, | |
inputs=gr.inputs.Textbox(lines=5, placeholder="Enter symptoms..."), | |
outputs=gr.outputs.Textbox(label="Diagnosis") | |
) | |
# Launch the interface | |
interface.launch() | |