Spaces:
Sleeping
Sleeping
app modified
Browse files
app.py
CHANGED
@@ -303,8 +303,7 @@ class ModeloDataset:
|
|
303 |
MAX_LEN=128
|
304 |
ids=pad_sequences(ids,maxlen=MAX_LEN,dtype="long",truncating="post", padding="post")
|
305 |
input_ids = torch.tensor(ids)
|
306 |
-
|
307 |
-
|
308 |
self.model = RobertaForTokenClassification.from_pretrained("BSC-LT/roberta_model_for_anonimization")
|
309 |
with torch.no_grad():
|
310 |
logits = self.model(input_ids).logits
|
@@ -361,7 +360,7 @@ class ModeloDataset:
|
|
361 |
print('ig_tok',ig_tok)
|
362 |
|
363 |
for items in _predicted_tokens_classes:
|
364 |
-
if i<len(
|
365 |
print('len(_predicted_tokens_classes)',len(items))
|
366 |
aux=self.reordenacion_identificadores(ig_tok[i],items)
|
367 |
new_identificadores.append(aux)
|
|
|
303 |
MAX_LEN=128
|
304 |
ids=pad_sequences(ids,maxlen=MAX_LEN,dtype="long",truncating="post", padding="post")
|
305 |
input_ids = torch.tensor(ids)
|
306 |
+
|
|
|
307 |
self.model = RobertaForTokenClassification.from_pretrained("BSC-LT/roberta_model_for_anonimization")
|
308 |
with torch.no_grad():
|
309 |
logits = self.model(input_ids).logits
|
|
|
360 |
print('ig_tok',ig_tok)
|
361 |
|
362 |
for items in _predicted_tokens_classes:
|
363 |
+
if i<len(new_tokens[i]):
|
364 |
print('len(_predicted_tokens_classes)',len(items))
|
365 |
aux=self.reordenacion_identificadores(ig_tok[i],items)
|
366 |
new_identificadores.append(aux)
|