Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -3,8 +3,11 @@ import tensorflow as tf
|
|
3 |
from tensorflow import keras
|
4 |
import gradio as gr
|
5 |
|
|
|
|
|
|
|
6 |
# Load the model
|
7 |
-
model_path = 'doctor_ai_model.h5' #
|
8 |
model = keras.models.load_model(model_path)
|
9 |
|
10 |
def predict(input_data):
|
@@ -25,10 +28,11 @@ def predict(input_data):
|
|
25 |
return predicted_class
|
26 |
|
27 |
# Create Gradio interface
|
28 |
-
iface = gr.Interface(
|
29 |
-
|
30 |
-
|
31 |
-
|
|
|
32 |
|
33 |
# Launch the Gradio app
|
34 |
iface.launch()
|
|
|
3 |
from tensorflow import keras
|
4 |
import gradio as gr
|
5 |
|
6 |
+
# Suppress TensorFlow logs
|
7 |
+
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
|
8 |
+
|
9 |
# Load the model
|
10 |
+
model_path = 'doctor_ai_model.h5' # Change to your model file
|
11 |
model = keras.models.load_model(model_path)
|
12 |
|
13 |
def predict(input_data):
|
|
|
28 |
return predicted_class
|
29 |
|
30 |
# Create Gradio interface
|
31 |
+
iface = gr.Interface(
|
32 |
+
fn=predict,
|
33 |
+
inputs=gr.Dataframe(type='numpy', label='Input Data (should have shape (None, 27))'),
|
34 |
+
outputs='json'
|
35 |
+
)
|
36 |
|
37 |
# Launch the Gradio app
|
38 |
iface.launch()
|