Spaces:
Sleeping
Sleeping
Faster training
Browse files
app.py
CHANGED
@@ -67,7 +67,7 @@ def train(data: str, message: str):
|
|
67 |
|
68 |
model.compile(loss="sparse_categorical_crossentropy", metrics=["accuracy",])
|
69 |
|
70 |
-
model.fit(X, y, epochs=
|
71 |
model.save(f"cache/{data_hash}.keras")
|
72 |
tokens = tokenizer.texts_to_sequences([message,])[0]
|
73 |
prediction = model.predict(np.array([(list(tokens)+[0,]*inp_len)[:inp_len],]))[0]
|
|
|
67 |
|
68 |
model.compile(loss="sparse_categorical_crossentropy", metrics=["accuracy",])
|
69 |
|
70 |
+
model.fit(X, y, epochs=16, batch_size=8, workers=4, use_multiprocessing=True)
|
71 |
model.save(f"cache/{data_hash}.keras")
|
72 |
tokens = tokenizer.texts_to_sequences([message,])[0]
|
73 |
prediction = model.predict(np.array([(list(tokens)+[0,]*inp_len)[:inp_len],]))[0]
|