Skip to content

Commit

Permalink
Update utils.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Luodian authored Jul 14, 2024
1 parent c65118d commit 4912aed
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lmms_eval/tasks/vcr_wiki/utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import datetime
import yaml
import json
import os

Expand All @@ -8,6 +9,7 @@
from nltk.util import ngrams
from spacy.cli import download

from pathlib import Path
from difflib import SequenceMatcher as SM
from functools import partial

Expand All @@ -25,7 +27,7 @@
config = yaml.safe_load("".join(safe_data))

# Download the English and Chinese models
if config["load_package"]:
if config["metadata"]["load_package"]:
try:
nlp_en = spacy.load("en_core_web_sm")
nlp_zh = spacy.load("zh_core_web_sm")
Expand All @@ -37,10 +39,10 @@
nlp_en = spacy.load("en_core_web_sm")
download("zh_core_web_sm")
nlp_zh = spacy.load("zh_core_web_sm")
eval_logger.debug("Spacy models not loaded due to load_package is False. Please set load_package to True in the config file to load them.")
else:
nlp = {"en": None, "zh": None}
rouge = None
eval_logger.debug("Spacy models not loaded due to load_package is False. Please set load_package to True in the config file to load them.")

aggregate_results_template = {
"max_sim_val": 0,
Expand Down

0 comments on commit 4912aed

Please sign in to comment.