Download backend/debug_env.py from Abhisingh-18/Trust-first-AI-Copilot: direct link, hf CLI and curl.
- Browser
- Download file 1.4 kB
-
https://huggingface.co/Abhisingh-18/Trust-first-AI-Copilot/resolve/main/backend/debug_env.py
- Command line
-
hf download hf://Abhisingh-18/Trust-first-AI-Copilot/backend/debug_env.py
-
curl -L -o debug_env.py https://huggingface.co/Abhisingh-18/Trust-first-AI-Copilot/resolve/main/backend/debug_env.py
1.4 kB
| 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}") | |