Spaces:
Runtime error
Runtime error
Bug Fix
Browse files
app.py
CHANGED
@@ -308,7 +308,7 @@ def check_softgoal_syntax(softgoals):
|
|
308 |
# ########## Incorrect Task Syntax ###########
|
309 |
def find_non_VPs(sentences):
|
310 |
|
311 |
-
pipeline = TokenClassificationPipeline(model=
|
312 |
|
313 |
outputs = pipeline(sentences)
|
314 |
|
@@ -402,9 +402,9 @@ def do_nli(premise, hypothesis):
|
|
402 |
seg_ids = []
|
403 |
mask_ids = []
|
404 |
|
405 |
-
premise_id =
|
406 |
-
hypothesis_id =
|
407 |
-
pair_token_ids = [
|
408 |
premise_len = len(premise_id)
|
409 |
hypothesis_len = len(hypothesis_id)
|
410 |
|
|
|
308 |
# ########## Incorrect Task Syntax ###########
|
309 |
def find_non_VPs(sentences):
|
310 |
|
311 |
+
pipeline = TokenClassificationPipeline(model=pos_model, tokenizer=pos_tokenizer)
|
312 |
|
313 |
outputs = pipeline(sentences)
|
314 |
|
|
|
402 |
seg_ids = []
|
403 |
mask_ids = []
|
404 |
|
405 |
+
premise_id = nli_tokenizer.encode(premise, add_special_tokens = False)
|
406 |
+
hypothesis_id = nli_tokenizer.encode(hypothesis, add_special_tokens = False)
|
407 |
+
pair_token_ids = [nli_tokenizer.cls_token_id] + premise_id + [nli_tokenizer.sep_token_id] + hypothesis_id + [nli_tokenizer.sep_token_id]
|
408 |
premise_len = len(premise_id)
|
409 |
hypothesis_len = len(hypothesis_id)
|
410 |
|