Skip to content

Commit

Permalink
* fix logger fileno undefined error
Browse files Browse the repository at this point in the history
* update downloading logics of models without file locks
  • Loading branch information
HYLcool committed Feb 27, 2025
1 parent e283e8d commit da06b01
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions data_juicer/utils/logger_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ def __init__(self, level='INFO', caller_names=('datasets', 'logging')):
self.buffer = StringIO()
self.BUFFER_SIZE = 1024 * 1024

def fileno(self):
return self.buffer.fileno()

def write(self, buf):
full_name = get_caller_name(depth=1)
module_name = full_name.rsplit('.', maxsplit=-1)[0]
Expand Down
3 changes: 2 additions & 1 deletion data_juicer/utils/model_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -864,7 +864,8 @@ def update_sampling_params(sampling_params,
}

_MODELS_WITHOUT_FILE_LOCK = {
'kenlm', 'nltk', 'recognizeAnything', 'sentencepiece', 'spacy'
'fasttext', 'fastsam', 'kenlm', 'nltk', 'recognizeAnything',
'sentencepiece', 'spacy'
}


Expand Down

0 comments on commit da06b01

Please sign in to comment.