File size: 556 Bytes
7a3fc7f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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()