Igor2004 commited on
Commit
9694044
·
1 Parent(s): 0a035f9

Upload app.py.txt

Browse files
Files changed (1) hide show
  1. app.py.txt +13 -0
app.py.txt ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import numpy as np
3
+ from huggingface_hub import from_pretrained_keras
4
+
5
+ model = from_pretrained_keras("vladimirchabanov/digits")
6
+
7
+ def greet(img):
8
+ img = np.expand_dims(img, axis = 0)
9
+ return np.argmax(model.predict(img)[0])
10
+
11
+
12
+ demo = gr.Interface(fn=greet, inputs="sketchpad", outputs="text")
13
+ demo.launch()