Update app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,13 @@
|
|
1 |
import gradio as gr
|
2 |
|
3 |
-
|
4 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
|
6 |
iface = gr.Interface(fn=greet, inputs="text", outputs="text")
|
7 |
iface.launch()
|
|
|
1 |
import gradio as gr
|
2 |
|
3 |
+
reloaded_model = tf.saved_model.load("./")
|
4 |
+
|
5 |
+
def sentiment(text):
|
6 |
+
reloaded_results = tf.sigmoid(reloaded_model(tf.constant([text])))
|
7 |
+
if reloaded_results[0].numpy()[0] > 0.5:
|
8 |
+
return "Positive"
|
9 |
+
else:
|
10 |
+
return "Negative"
|
11 |
|
12 |
iface = gr.Interface(fn=greet, inputs="text", outputs="text")
|
13 |
iface.launch()
|