Spaces:
Runtime error
Runtime error
Update model.py
Browse files
model.py
CHANGED
|
@@ -1,17 +1,11 @@
|
|
| 1 |
-
import os
|
| 2 |
import tensorflow as tf
|
| 3 |
-
from tensorflow.keras import layers, models
|
| 4 |
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
layers.
|
| 9 |
-
layers.Dense(256, activation='relu'),
|
| 10 |
-
layers.Dense(128, activation='relu'),
|
| 11 |
-
layers.Dense(80)
|
| 12 |
])
|
| 13 |
|
| 14 |
-
model
|
| 15 |
-
model.save(
|
| 16 |
-
|
| 17 |
-
print("Model saved to model/clone_tts_model.h5")
|
|
|
|
|
|
|
| 1 |
import tensorflow as tf
|
|
|
|
| 2 |
|
| 3 |
+
# Assume you have a trained model already (replace with your own model code)
|
| 4 |
+
model = tf.keras.Sequential([
|
| 5 |
+
tf.keras.layers.Dense(128, activation='relu', input_shape=(784,)),
|
| 6 |
+
tf.keras.layers.Dense(10, activation='softmax')
|
|
|
|
|
|
|
|
|
|
| 7 |
])
|
| 8 |
|
| 9 |
+
# Save the model to a file
|
| 10 |
+
model.save('my_model.h5') # Save in HDF5 format
|
| 11 |
+
print("Model saved successfully!")
|
|
|