Spaces:
Sleeping
Sleeping
vhr1007
commited on
Commit
•
c7e9ccf
1
Parent(s):
3408e43
debug
Browse files
app.py
CHANGED
@@ -30,7 +30,7 @@ logging.basicConfig(level=logging.INFO)
|
|
30 |
huggingface_token = os.getenv('HUGGINGFACE_HUB_TOKEN')
|
31 |
if huggingface_token:
|
32 |
try:
|
33 |
-
login(token=huggingface_token, add_to_git_credential=True)
|
34 |
logging.info("Successfully logged into Hugging Face Hub.")
|
35 |
except Exception as e:
|
36 |
logging.error(f"Failed to log into Hugging Face Hub: {e}")
|
@@ -48,7 +48,7 @@ if not qdrant_url or not access_token:
|
|
48 |
# Initialize the SentenceTransformer model with the cache directory managed by HF_HOME
|
49 |
try:
|
50 |
cache_folder = os.path.join(hf_home_dir, "transformers_cache")
|
51 |
-
encoder = SentenceTransformer('nomic-ai/nomic-embed-text-v1.5', cache_folder=cache_folder)
|
52 |
logging.info("Successfully loaded the SentenceTransformer model.")
|
53 |
except Exception as e:
|
54 |
logging.error(f"Failed to load the SentenceTransformer model: {e}")
|
|
|
30 |
huggingface_token = os.getenv('HUGGINGFACE_HUB_TOKEN')
|
31 |
if huggingface_token:
|
32 |
try:
|
33 |
+
login(token=huggingface_token, add_to_git_credential=True, write_permission=True)
|
34 |
logging.info("Successfully logged into Hugging Face Hub.")
|
35 |
except Exception as e:
|
36 |
logging.error(f"Failed to log into Hugging Face Hub: {e}")
|
|
|
48 |
# Initialize the SentenceTransformer model with the cache directory managed by HF_HOME
|
49 |
try:
|
50 |
cache_folder = os.path.join(hf_home_dir, "transformers_cache")
|
51 |
+
encoder = SentenceTransformer('nomic-ai/nomic-embed-text-v1.5', cache_folder=cache_folder, trust_remote_code=True)
|
52 |
logging.info("Successfully loaded the SentenceTransformer model.")
|
53 |
except Exception as e:
|
54 |
logging.error(f"Failed to load the SentenceTransformer model: {e}")
|