Spaces:
Paused
Paused
File size: 2,993 Bytes
26e8660 |
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 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
#!/usr/bin/env python3
"""
Test script to verify AI Resume Screener installation
"""
import sys
import importlib
def test_import(module_name, package_name=None):
"""Test if a module can be imported"""
try:
importlib.import_module(module_name)
print(f"β
{package_name or module_name}")
return True
except ImportError as e:
print(f"β {package_name or module_name}: {e}")
return False
def main():
print("π§ͺ Testing AI Resume Screener Installation\n")
# Core dependencies
print("π¦ Core Dependencies:")
core_deps = [
("streamlit", "Streamlit"),
("pandas", "Pandas"),
("numpy", "NumPy"),
("plotly", "Plotly"),
]
core_success = all(test_import(module, name) for module, name in core_deps)
# ML/AI dependencies
print("\nπ€ ML/AI Dependencies:")
ml_deps = [
("sentence_transformers", "Sentence Transformers"),
("transformers", "Transformers"),
("torch", "PyTorch"),
("faiss", "FAISS"),
("rank_bm25", "Rank BM25"),
("nltk", "NLTK"),
]
ml_success = all(test_import(module, name) for module, name in ml_deps)
# File processing dependencies
print("\nπ File Processing Dependencies:")
file_deps = [
("pdfplumber", "PDF Plumber"),
("PyPDF2", "PyPDF2"),
("docx", "python-docx"),
("datasets", "Hugging Face Datasets"),
]
file_success = all(test_import(module, name) for module, name in file_deps)
# Optional dependencies
print("\nβ‘ Optional Dependencies:")
optional_deps = [
("accelerate", "Accelerate"),
("bitsandbytes", "BitsAndBytes"),
]
for module, name in optional_deps:
test_import(module, name)
# Summary
print("\n" + "="*50)
if core_success and ml_success and file_success:
print("π All required dependencies are installed!")
print("β
Ready to run AI Resume Screener")
# Test basic functionality
print("\nπ§ Testing basic functionality...")
try:
import pandas as pd
import numpy as np
from sentence_transformers import SentenceTransformer
# Test data creation
test_df = pd.DataFrame({'test': [1, 2, 3]})
test_array = np.array([1, 2, 3])
print("β
Pandas and NumPy working")
print("β
Installation test completed successfully!")
except Exception as e:
print(f"β Basic functionality test failed: {e}")
else:
print("β Some required dependencies are missing")
print("π Please install missing packages using:")
print(" pip install -r requirements.txt")
print("\nπ To run the application:")
print(" streamlit run src/streamlit_app.py")
if __name__ == "__main__":
main() |