Skip to content

Commit 7fba0b7

Browse files
authored
Introduce compatibility with Sentence Transformers v4.0 (#595)
* Introduce compatibility with Sentence Transformers v4.0 I think v3.4.1 might have also been problematic before * Run upgraded formatter * Avoid global call without assigning
1 parent 1dab293 commit 7fba0b7

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/setfit/logging.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# limitations under the License.
1515
#
1616
# Copied from: https://github.com/huggingface/transformers/blob/main/src/transformers/utils/logging.py
17-
""" Logging utilities."""
17+
"""Logging utilities."""
1818

1919
import logging
2020
import os
@@ -327,7 +327,6 @@ def get_lock(self):
327327

328328
def is_progress_bar_enabled() -> bool:
329329
"""Return a boolean indicating whether tqdm progress bars are enabled."""
330-
global _tqdm_active
331330
return bool(_tqdm_active)
332331

333332

src/setfit/trainer.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,9 @@ def overwritten_call_event(self, event, args, state, control, **kwargs):
103103
self.add_callback(callback)
104104
self.callback_handler.on_init_end(self.args, self.state, self.control)
105105

106+
def add_model_card_callback(self, *args, **kwargs):
107+
pass
108+
106109
@property
107110
def setfit_model(self) -> "SetFitModel":
108111
return self._setfit_model

0 commit comments

Comments
 (0)