Skip to content

Commit

Permalink
fix HF repo name issue when pushing
Browse files Browse the repository at this point in the history
  • Loading branch information
bagustris committed May 29, 2024
1 parent 8d72dd6 commit 4dc252b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
5 changes: 3 additions & 2 deletions nkululeko/experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,9 @@ def store_report(self):
if self.util.config_val("REPORT", "latex", False):
self.report.export_latex()

def get_name(self):
return self.util.get_exp_name()
# moved to util
# def get_name(self):
# return self.util.get_exp_name()

def set_globals(self, config_obj):
"""install a config object in the global space"""
Expand Down
1 change: 1 addition & 0 deletions nkululeko/models/model_tuned.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ def compute_loss(
remove_unused_columns=False,
report_to="none",
push_to_hub=push,
hub_model_id=f"{self.util.get_name()}",
)

trainer = Trainer(
Expand Down
6 changes: 6 additions & 0 deletions nkululeko/utils/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,12 @@ def is_categorical(self, pd_series):
pd_series.dtype, pd.CategoricalDtype
)

def get_name(self):
"""
Get the name of the experiment
"""
return self.config["EXP"]["name"]

def get_exp_dir(self):
"""
Get the experiment directory
Expand Down

0 comments on commit 4dc252b

Please sign in to comment.