Update src/text_embedding.py
Browse files- src/text_embedding.py +5 -5
src/text_embedding.py
CHANGED
@@ -11,12 +11,12 @@ class TextExtractor:
|
|
11 |
- model_name (str): The name of the pre-trained model to load from HuggingFace Hub.
|
12 |
- proxy (str, optional): The proxy address to use for HTTP and HTTPS requests.
|
13 |
"""
|
14 |
-
if proxy is None:
|
15 |
-
|
16 |
|
17 |
-
if proxy:
|
18 |
-
|
19 |
-
|
20 |
try:
|
21 |
self.tokenizer = AutoTokenizer.from_pretrained(model_name)
|
22 |
self.model = AutoModel.from_pretrained(model_name)
|
|
|
11 |
- model_name (str): The name of the pre-trained model to load from HuggingFace Hub.
|
12 |
- proxy (str, optional): The proxy address to use for HTTP and HTTPS requests.
|
13 |
"""
|
14 |
+
# if proxy is None:
|
15 |
+
# proxy = 'http://localhost:8234'
|
16 |
|
17 |
+
# if proxy:
|
18 |
+
# os.environ['HTTP_PROXY'] = proxy
|
19 |
+
# os.environ['HTTPS_PROXY'] = proxy
|
20 |
try:
|
21 |
self.tokenizer = AutoTokenizer.from_pretrained(model_name)
|
22 |
self.model = AutoModel.from_pretrained(model_name)
|