Spaces:
Runtime error
Runtime error
Commit
·
10432c9
1
Parent(s):
9888dff
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,6 +2,8 @@ import numpy as np
|
|
| 2 |
from tensorflow import keras
|
| 3 |
from tensorflow.keras import layers
|
| 4 |
|
|
|
|
|
|
|
| 5 |
def to_numpy(examples):
|
| 6 |
examples["pixel_values"] = [np.array(image) for image in examples["image"]]
|
| 7 |
return examples
|
|
@@ -51,4 +53,6 @@ def training():
|
|
| 51 |
score = model.evaluate(x_test, y_test, verbose=0)
|
| 52 |
print("Test loss:", score[0])
|
| 53 |
print("Test accuracy:", score[1])
|
|
|
|
|
|
|
| 54 |
|
|
|
|
| 2 |
from tensorflow import keras
|
| 3 |
from tensorflow.keras import layers
|
| 4 |
|
| 5 |
+
from huggingface_hub import push_to_hub_keras
|
| 6 |
+
|
| 7 |
def to_numpy(examples):
|
| 8 |
examples["pixel_values"] = [np.array(image) for image in examples["image"]]
|
| 9 |
return examples
|
|
|
|
| 53 |
score = model.evaluate(x_test, y_test, verbose=0)
|
| 54 |
print("Test loss:", score[0])
|
| 55 |
print("Test accuracy:", score[1])
|
| 56 |
+
|
| 57 |
+
push_to_hub_keras(model, "active-learning/mnist_classifier")
|
| 58 |
|