Skip to content

Commit

Permalink
🐛 Fix trust_remote_code=True bug in tests
Browse files Browse the repository at this point in the history
Signed-off-by: Marcos Martínez Galindo <marcosmartinezgalindo@marcoss-mbp.mul.ie.ibm.com>
  • Loading branch information
Marcos Martínez Galindo committed Jul 23, 2024
1 parent 5bc52a5 commit 6a48d07
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion zshot/evaluation/dataset/fewrel/fewrel.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def get_entity_data(e, tokenized_sentence):

def load_few_rel_zs(split: Optional[Union[str, Split]] = "val_wiki") -> Union[Dict[DatasetWithRelations,
Dataset], Dataset]:
dataset = load_dataset("few_rel", split=split)
dataset = load_dataset("few_rel", split=split, trust_remote_code=True)
relations_descriptions = dataset["names"]
tokenized_sentences = dataset["tokens"]
sentences = [" ".join(tokens) for tokens in tokenized_sentences]
Expand Down
2 changes: 1 addition & 1 deletion zshot/evaluation/dataset/med_mentions/med_mentions.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@


def load_medmentions_zs(split: Optional[Union[str, Split]] = None, **kwargs) -> Union[DatasetDict, Dataset]:
dataset = load_dataset(REPO_ID, split=split, **kwargs)
dataset = load_dataset(REPO_ID, split=split, trust_remote_code=True, **kwargs)
entities_file = hf_hub_download(repo_id=REPO_ID,
repo_type='dataset',
filename=ENTITIES_FN)
Expand Down
2 changes: 1 addition & 1 deletion zshot/evaluation/dataset/ontonotes/onto_notes.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def remove_out_of_split(sentence, split):
def load_ontonotes_zs(split: Optional[Union[str, Split]] = None, **kwargs) -> Union[Dict[DatasetWithEntities,
Dataset], Dataset]:
dataset_zs = load_dataset("conll2012_ontonotesv5", "english_v12",
split=split, verification_mode='no_checks', **kwargs)
split=split, verification_mode='no_checks', trust_remote_code=True, **kwargs)
if split:
ontonotes_zs = preprocess_spit(dataset_zs, get_simple_split(split))
else:
Expand Down

0 comments on commit 6a48d07

Please sign in to comment.