Dodanie modelu Keras
Browse files
README.md
CHANGED
|
@@ -108,8 +108,14 @@ model.fit(
|
|
| 108 |
import numpy as np
|
| 109 |
import pandas as pd
|
| 110 |
import tensorflow as tf
|
|
|
|
| 111 |
|
| 112 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 113 |
|
| 114 |
x_new = pd.DataFrame([{
|
| 115 |
"sepal length (cm)": 5.1,
|
|
@@ -123,4 +129,5 @@ pred = int(np.argmax(proba))
|
|
| 123 |
|
| 124 |
print("Probabilities:", proba)
|
| 125 |
print("Predicted class:", pred)
|
|
|
|
| 126 |
```
|
|
|
|
| 108 |
import numpy as np
|
| 109 |
import pandas as pd
|
| 110 |
import tensorflow as tf
|
| 111 |
+
from huggingface_hub import hf_hub_download
|
| 112 |
|
| 113 |
+
filename = "iris_mlp.keras"
|
| 114 |
+
repo_id = "studentscolab/iris_keras"
|
| 115 |
+
|
| 116 |
+
model_path = hf_hub_download(repo_id=repo_id, filename=filename)
|
| 117 |
+
|
| 118 |
+
model = tf.keras.models.load_model(model_path)
|
| 119 |
|
| 120 |
x_new = pd.DataFrame([{
|
| 121 |
"sepal length (cm)": 5.1,
|
|
|
|
| 129 |
|
| 130 |
print("Probabilities:", proba)
|
| 131 |
print("Predicted class:", pred)
|
| 132 |
+
|
| 133 |
```
|