Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import tensorflow as tf
|
2 |
+
from gradio import Interface
|
3 |
+
|
4 |
+
# Load your TensorFlow model
|
5 |
+
model = tf.keras.models.load_model("mnist_model.h5")
|
6 |
+
|
7 |
+
# Define the input and output components of your interface
|
8 |
+
iface = Interface(
|
9 |
+
fn=model.predict, # Pass your model's prediction function
|
10 |
+
inputs=["image"], # Adjust input components as needed
|
11 |
+
outputs="label", # Adjust output components as needed
|
12 |
+
)
|
13 |
+
|
14 |
+
# Launch the web app
|
15 |
+
iface.launch(share=True)
|