Spaces:
Sleeping
Sleeping
Commit
·
ab9d8b6
1
Parent(s):
6a9b1ed
add model2.pkl and corresponding getters
Browse files- app.py +5 -4
- digit-5.png +0 -0
- model2.pkl +3 -0
app.py
CHANGED
|
@@ -19,16 +19,17 @@ app.add_middleware(
|
|
| 19 |
|
| 20 |
def get_x(i):
|
| 21 |
# Convert NumPy array to a single-channel PIL image with inverted colors
|
| 22 |
-
return PILImageBW.create(
|
| 23 |
|
| 24 |
def get_y(i):
|
| 25 |
-
return
|
| 26 |
|
| 27 |
def get_items(_):
|
| 28 |
-
return range(len(
|
| 29 |
|
| 30 |
# Load the model
|
| 31 |
-
learn = load_learner('model.pkl')
|
|
|
|
| 32 |
|
| 33 |
@app.get("/")
|
| 34 |
def read_root():
|
|
|
|
| 19 |
|
| 20 |
def get_x(i):
|
| 21 |
# Convert NumPy array to a single-channel PIL image with inverted colors
|
| 22 |
+
return PILImageBW.create(x[i])
|
| 23 |
|
| 24 |
def get_y(i):
|
| 25 |
+
return y[i].astype(np.float32)
|
| 26 |
|
| 27 |
def get_items(_):
|
| 28 |
+
return range(len(x))
|
| 29 |
|
| 30 |
# Load the model
|
| 31 |
+
#learn = load_learner('model.pkl')
|
| 32 |
+
learn = load_learner('model2.pkl')
|
| 33 |
|
| 34 |
@app.get("/")
|
| 35 |
def read_root():
|
digit-5.png
ADDED
|
model2.pkl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1782bbc0c2083d506c1eb98179a584a19a66964286be72acc30685b526522508
|
| 3 |
+
size 88336243
|