szili2011 commited on
Commit
5bd3f2b
1 Parent(s): 19cb6e6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -5
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' # or .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(fn=predict,
29
- inputs=gr.inputs.Dataframe(type='numpy',
30
- label='Input Data (should have shape (None, 27))'),
31
- outputs='json')
 
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()