Spaces:
Runtime error
Runtime error
Upload app.py
Browse files
app.py
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import os
|
2 |
+
import tensorflow as tf
|
3 |
+
import gradio as gr
|
4 |
+
import numpy as np
|
5 |
+
|
6 |
+
|
7 |
+
loaded_model = tf.keras.saving.load_model('./model/linear_regressor.keras')
|
8 |
+
|
9 |
+
def test_ml_model(input):
|
10 |
+
result = loaded_model.predict(([input]))
|
11 |
+
return (f'predicted: {result}')
|
12 |
+
|
13 |
+
demo = gr.Interface(fn=test_ml_model, inputs=gr.Slider(0, 100, step=1),
|
14 |
+
outputs="text",
|
15 |
+
description="A sample linear regressor solution.",
|
16 |
+
title='Synthetic Data Linear Regressor Solution')
|
17 |
+
|
18 |
+
demo.launch()
|