Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -62,6 +62,7 @@ def save_token_and_phrase(token, phrase):
|
|
62 |
def get_valid_predictions(sentence, max_attempts=3, top_k=5):
|
63 |
"""Verifica se la frase è già salvata e usa il token corrispondente."""
|
64 |
data = load_data()
|
|
|
65 |
if sentence in data["phrases"]:
|
66 |
return [{"token_str": data["phrases"][sentence], "score": 1.0, "sequence": sentence.replace("[MASK]", data["phrases"][sentence])}]
|
67 |
|
|
|
62 |
def get_valid_predictions(sentence, max_attempts=3, top_k=5):
|
63 |
"""Verifica se la frase è già salvata e usa il token corrispondente."""
|
64 |
data = load_data()
|
65 |
+
print(data)
|
66 |
if sentence in data["phrases"]:
|
67 |
return [{"token_str": data["phrases"][sentence], "score": 1.0, "sequence": sentence.replace("[MASK]", data["phrases"][sentence])}]
|
68 |
|