Spaces:
Running
on
Zero
Running
on
Zero
Felipe Silva
commited on
Commit
·
81ce4aa
1
Parent(s):
7eaebec
ajuste
Browse files- rag_utils.py +1 -2
rag_utils.py
CHANGED
|
@@ -24,13 +24,12 @@ _embedding_instance = None
|
|
| 24 |
_model_instance = None
|
| 25 |
_tokenizer = None
|
| 26 |
|
| 27 |
-
@spaces.GPU
|
| 28 |
def get_embedding_model():
|
| 29 |
global _embedding_instance
|
| 30 |
if _embedding_instance is None:
|
| 31 |
if config.local_emb_path is None:
|
| 32 |
raise ValueError("⚠️ config.local_emb_path ainda não foi inicializado!")
|
| 33 |
-
_embedding_instance = HuggingFaceEmbeddings(model_name=config.local_emb_path)
|
| 34 |
return _embedding_instance
|
| 35 |
|
| 36 |
# model_name = "Qwen/Qwen2.5-7B-Instruct-GPTQ-Int8" #"Qwen/Qwen2.5-7B-Instruct-AWQ" #"Qwen/Qwen2.5-7B-Instruct"
|
|
|
|
| 24 |
_model_instance = None
|
| 25 |
_tokenizer = None
|
| 26 |
|
|
|
|
| 27 |
def get_embedding_model():
|
| 28 |
global _embedding_instance
|
| 29 |
if _embedding_instance is None:
|
| 30 |
if config.local_emb_path is None:
|
| 31 |
raise ValueError("⚠️ config.local_emb_path ainda não foi inicializado!")
|
| 32 |
+
_embedding_instance = HuggingFaceEmbeddings(model_name=config.local_emb_path, model_kwargs={"device": "cpu"})
|
| 33 |
return _embedding_instance
|
| 34 |
|
| 35 |
# model_name = "Qwen/Qwen2.5-7B-Instruct-GPTQ-Int8" #"Qwen/Qwen2.5-7B-Instruct-AWQ" #"Qwen/Qwen2.5-7B-Instruct"
|