File size: 1,399 Bytes
f35583f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import os
from dotenv import load_dotenv
load_dotenv()

print("--- ENV DEBUG ---")
hf_key = os.getenv("HUGGINGFACE_API_KEY")
print(f"HF Key present: {bool(hf_key)}")
print(f"HF Key start: {hf_key[:4] if hf_key else 'None'}")

print("\n--- LIBRARY DEBUG ---")
try:
    import huggingface_hub
    print(f"huggingface_hub version: {huggingface_hub.__version__}")
except ImportError:
    print("huggingface_hub NOT installed")

try:
    from huggingface_hub import AsyncInferenceClient
    print("AsyncInferenceClient imported successfully")
except ImportError as e:
    print(f"AsyncInferenceClient import FAILED: {e}")

try:
    from huggingface_hub import InferenceClient
    print("InferenceClient imported successfully")
except ImportError as e:
    print(f"InferenceClient import FAILED: {e}")

print("\n--- VECTOR DB DEBUG ---")
try:
    import faiss
    print(f"FAISS imported successfully")
except ImportError:
    print("FAISS NOT installed")

try:
    from sentence_transformers import SentenceTransformer
    print("SentenceTransformer imported successfully")
except ImportError:
    print("SentenceTransformer NOT installed")

print("\n--- APP CONFIG DEBUG ---")
try:
    from app.core.config import settings
    print(f"Settings HF Key: {bool(settings.HUGGINGFACE_API_KEY)}")
except Exception as e:
    print(f"Could not load settings: {e}")