Spaces:
Runtime error
Runtime error
CesarLeblanc
commited on
Commit
•
29188eb
1
Parent(s):
f80db47
Update app.py
Browse files
app.py
CHANGED
@@ -131,13 +131,13 @@ def masking(text):
|
|
131 |
# Case for the last position
|
132 |
masked_text = ', '.join(text.split(', ')) + ', [MASK]'
|
133 |
i = 0
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
score = prediction['score']
|
142 |
sentence = prediction['sequence']
|
143 |
|
|
|
131 |
# Case for the last position
|
132 |
masked_text = ', '.join(text.split(', ')) + ', [MASK]'
|
133 |
i = 0
|
134 |
+
while True:
|
135 |
+
prediction = mask_model(masked_text)[i]
|
136 |
+
species = prediction['token_str']
|
137 |
+
if species in text.split(', '):
|
138 |
+
i+=1
|
139 |
+
else:
|
140 |
+
break
|
141 |
score = prediction['score']
|
142 |
sentence = prediction['sequence']
|
143 |
|