Skip to content

Commit fac137e

Browse files
committed
- removed htrack_block in src/lighteval/main_nanotron.py
- fixed import path for NanotronLightevalModel src/lighteval/pipeline.py
1 parent 20cff95 commit fac137e

File tree

2 files changed

+15
-18
lines changed

2 files changed

+15
-18
lines changed

src/lighteval/main_nanotron.py

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ def nanotron(
5252

5353
from lighteval.config.lighteval_config import FullNanotronConfig, LightEvalConfig
5454
from lighteval.logging.evaluation_tracker import EvaluationTracker
55-
from lighteval.logging.hierarchical_logger import htrack_block
5655
from lighteval.pipeline import ParallelismManager, Pipeline, PipelineParameters
5756
from lighteval.utils.imports import NO_NANOTRON_ERROR_MSG, is_nanotron_available
5857
from lighteval.utils.utils import EnvConfig
@@ -62,22 +61,20 @@ def nanotron(
6261
if not is_nanotron_available():
6362
raise ImportError(NO_NANOTRON_ERROR_MSG)
6463

65-
with htrack_block("Load nanotron config"):
66-
# Create nanotron config
67-
if not checkpoint_config_path.endswith(".yaml"):
68-
raise ValueError("The checkpoint path should point to a YAML file")
69-
70-
model_config = get_config_from_file(
71-
checkpoint_config_path,
72-
config_class=Config,
73-
model_config_class=None,
74-
skip_unused_config_keys=True,
75-
skip_null_keys=True,
76-
)
77-
78-
# We are getting an type error, because the get_config_from_file is not correctly typed,
79-
lighteval_config: LightEvalConfig = get_config_from_file(lighteval_config_path, config_class=LightEvalConfig) # type: ignore
80-
nanotron_config = FullNanotronConfig(lighteval_config, model_config)
64+
if not checkpoint_config_path.endswith(".yaml"):
65+
raise ValueError("The checkpoint path should point to a YAML file")
66+
67+
model_config = get_config_from_file(
68+
checkpoint_config_path,
69+
config_class=Config,
70+
model_config_class=None,
71+
skip_unused_config_keys=True,
72+
skip_null_keys=True,
73+
)
74+
75+
# We are getting an type error, because the get_config_from_file is not correctly typed,
76+
lighteval_config: LightEvalConfig = get_config_from_file(lighteval_config_path, config_class=LightEvalConfig) # type: ignore
77+
nanotron_config = FullNanotronConfig(lighteval_config, model_config)
8178

8279
evaluation_tracker = EvaluationTracker(
8380
output_dir=lighteval_config.logging.output_dir,

src/lighteval/pipeline.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
from nanotron.parallel.context import ParallelContext
7373
from nanotron.utils import local_ranks_zero_first
7474

75-
from lighteval.models.nanotron_model import NanotronLightevalModel
75+
from lighteval.models.nanotron.nanotron_model import NanotronLightevalModel
7676

7777

7878
import logging

0 commit comments

Comments
 (0)