Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -74,7 +74,7 @@ def apprendre(liste_actuelle):
|
|
| 74 |
|
| 75 |
# fonction pour prédire le mot suivant
|
| 76 |
def predict_next_word(start_text):
|
| 77 |
-
next_words = 5 if
|
| 78 |
print(f"prédictions de {nb} mots.")
|
| 79 |
for _ in range(next_words):
|
| 80 |
token_list = tokenizer.texts_to_sequences([start_text])[0]
|
|
|
|
| 74 |
|
| 75 |
# fonction pour prédire le mot suivant
|
| 76 |
def predict_next_word(start_text):
|
| 77 |
+
next_words = 5 if start_text.count(" ")<5 else 3
|
| 78 |
print(f"prédictions de {nb} mots.")
|
| 79 |
for _ in range(next_words):
|
| 80 |
token_list = tokenizer.texts_to_sequences([start_text])[0]
|