Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,13 +1,16 @@
|
|
1 |
import gradio as gr
|
2 |
import pickle
|
3 |
import numpy as np
|
4 |
-
model = pickle.load(open("model.pkl","rb"))
|
5 |
|
6 |
-
def
|
7 |
try:
|
8 |
-
if
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
|
|
|
|
|
|
|
|
|
1 |
import gradio as gr
|
2 |
import pickle
|
3 |
import numpy as np
|
|
|
4 |
|
5 |
+
def test(k):
|
6 |
try:
|
7 |
+
if k == None:
|
8 |
+
pass
|
9 |
+
except:
|
10 |
+
print(k.shape)
|
11 |
+
k = k / 255.
|
12 |
+
return np.argmax(model.predict(k))
|
13 |
+
gr.Interface(inputs=gr.Sketchpad(),
|
14 |
+
outputs="number",
|
15 |
+
fn=test,
|
16 |
+
live=True).launch()
|