Spaces:
Sleeping
Sleeping
Delete verify_dependencies.py
Browse files- verify_dependencies.py +0 -102
verify_dependencies.py
DELETED
|
@@ -1,102 +0,0 @@
|
|
| 1 |
-
"""
|
| 2 |
-
Verify all dependencies are installed correctly
|
| 3 |
-
Run: python verify_dependencies.py
|
| 4 |
-
"""
|
| 5 |
-
|
| 6 |
-
import sys
|
| 7 |
-
|
| 8 |
-
def check_dependency(module_name, package_name=None):
|
| 9 |
-
"""Check if a dependency is installed"""
|
| 10 |
-
if package_name is None:
|
| 11 |
-
package_name = module_name
|
| 12 |
-
|
| 13 |
-
try:
|
| 14 |
-
__import__(module_name)
|
| 15 |
-
print(f"✓ {package_name}")
|
| 16 |
-
return True
|
| 17 |
-
except ImportError as e:
|
| 18 |
-
print(f"✗ {package_name} - NOT INSTALLED")
|
| 19 |
-
print(f" Error: {e}")
|
| 20 |
-
return False
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
def main():
|
| 24 |
-
print("="*60)
|
| 25 |
-
print("Dependency Verification")
|
| 26 |
-
print("="*60)
|
| 27 |
-
|
| 28 |
-
dependencies = [
|
| 29 |
-
# Web framework
|
| 30 |
-
("fastapi", "fastapi"),
|
| 31 |
-
("uvicorn", "uvicorn"),
|
| 32 |
-
("multipart", "python-multipart"),
|
| 33 |
-
|
| 34 |
-
# ML & Embeddings
|
| 35 |
-
("torch", "torch"),
|
| 36 |
-
("transformers", "transformers"),
|
| 37 |
-
("PIL", "pillow"),
|
| 38 |
-
("numpy", "numpy"),
|
| 39 |
-
|
| 40 |
-
# Vector DB
|
| 41 |
-
("qdrant_client", "qdrant-client"),
|
| 42 |
-
|
| 43 |
-
# Utilities
|
| 44 |
-
("pydantic", "pydantic"),
|
| 45 |
-
("dotenv", "python-dotenv"),
|
| 46 |
-
|
| 47 |
-
# MongoDB
|
| 48 |
-
("pymongo", "pymongo"),
|
| 49 |
-
("huggingface_hub", "huggingface-hub"),
|
| 50 |
-
("timm", "timm"),
|
| 51 |
-
("einops", "einops"),
|
| 52 |
-
|
| 53 |
-
# PDF Processing (NEW)
|
| 54 |
-
("pypdfium2", "pypdfium2"),
|
| 55 |
-
]
|
| 56 |
-
|
| 57 |
-
print("\nChecking dependencies...\n")
|
| 58 |
-
|
| 59 |
-
all_ok = True
|
| 60 |
-
for module, package in dependencies:
|
| 61 |
-
if not check_dependency(module, package):
|
| 62 |
-
all_ok = False
|
| 63 |
-
|
| 64 |
-
print("\n" + "="*60)
|
| 65 |
-
if all_ok:
|
| 66 |
-
print("✓ All dependencies installed successfully!")
|
| 67 |
-
print("\nYou can now run:")
|
| 68 |
-
print(" python main.py")
|
| 69 |
-
else:
|
| 70 |
-
print("✗ Some dependencies are missing!")
|
| 71 |
-
print("\nPlease install missing dependencies:")
|
| 72 |
-
print(" pip install -r requirements.txt")
|
| 73 |
-
sys.exit(1)
|
| 74 |
-
|
| 75 |
-
print("="*60)
|
| 76 |
-
|
| 77 |
-
# Check optional features
|
| 78 |
-
print("\nChecking system modules...\n")
|
| 79 |
-
|
| 80 |
-
# Check our custom modules
|
| 81 |
-
custom_modules = [
|
| 82 |
-
"embedding_service",
|
| 83 |
-
"qdrant_service",
|
| 84 |
-
"advanced_rag",
|
| 85 |
-
"pdf_parser",
|
| 86 |
-
"multimodal_pdf_parser",
|
| 87 |
-
]
|
| 88 |
-
|
| 89 |
-
for module in custom_modules:
|
| 90 |
-
try:
|
| 91 |
-
__import__(module)
|
| 92 |
-
print(f"✓ {module}.py")
|
| 93 |
-
except ImportError as e:
|
| 94 |
-
print(f"✗ {module}.py - ERROR: {e}")
|
| 95 |
-
|
| 96 |
-
print("\n" + "="*60)
|
| 97 |
-
print("Verification complete!")
|
| 98 |
-
print("="*60)
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
if __name__ == "__main__":
|
| 102 |
-
main()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|