Skip to content

Commit f2d7e1e

Browse files
committed
[#24213] Applied revision
Signed-off-by: danipiza <dpizarrogallego@gmail.com>
1 parent 04e227d commit f2d7e1e

2 files changed

Lines changed: 9 additions & 15 deletions

File tree

src/vulcanai/console/console.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,6 @@ class VulcanConsole(App):
105105
width: 100%;
106106
}
107107
108-
#history_title {
109-
color: #ffffff;
110-
}
111-
112108
#variables {
113109
color: #ffffff;
114110
}
@@ -134,8 +130,13 @@ def __init__(
134130
user_context: str = "",
135131
main_node=None,
136132
):
133+
# Used to set the same textual colors in a docker container
137134
os.environ.setdefault("COLORTERM", "truecolor")
138135
textual_constants.COLOR_SYSTEM = "truecolor"
136+
137+
# Keep Hugging Face download progress bars out of redirected Textual stdout/stderr.
138+
os.environ.setdefault("HF_HUB_DISABLE_PROGRESS_BARS", "1")
139+
139140
super().__init__() # Textual lib
140141

141142
# -- Main variables --

src/vulcanai/tools/embedder.py

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,34 +12,27 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
import os
1615
from typing import Optional
1716

1817
import numpy as np
19-
20-
# Keep Hugging Face download progress bars out of redirected Textual stdout/stderr.
21-
os.environ.setdefault("HF_HUB_DISABLE_PROGRESS_BARS", "1")
22-
2318
from sentence_transformers import SentenceTransformer
2419

2520
from vulcanai.console.logger import VulcanAILogger
2621

27-
_HF_DOWNLOAD_INFO_PRINTED = False
28-
2922

3023
def info_msg_hf_model_loading(model_name: str, logger: Optional[VulcanAILogger] = None) -> None:
31-
global _HF_DOWNLOAD_INFO_PRINTED
24+
hf_download_info_printed = False
3225

33-
if _HF_DOWNLOAD_INFO_PRINTED:
26+
if hf_download_info_printed:
3427
return
3528

3629
msg = f"Hugging Face is loading '{model_name}'. If the model is not cached yet, files are being downloaded..."
3730
if logger is not None:
3831
logger.log_console(msg)
3932
else:
40-
VulcanAILogger.log_console(msg)
33+
VulcanAILogger.default().log_console(msg)
4134

42-
_HF_DOWNLOAD_INFO_PRINTED = True
35+
hf_download_info_printed = True
4336

4437

4538
class SBERTEmbedder:

0 commit comments

Comments
 (0)