fix mixups

This commit is contained in:
OwusuBlessing
2025-04-09 01:13:11 +01:00
parent 2c19c3265d
commit 266da24ea7
5 changed files with 585 additions and 363 deletions
+4 -61
View File
@@ -1,61 +1,4 @@
import subprocess
import re
# List of packages you want to include
packages = [
"openai",
"pandas",
"python-dotenv",
"fastapi",
"uvicorn",
"langchain-community",
"langchain-openai",
"pydantic",
"pypdf",
"pypandoc",
"plum-dispatch==1.7.4", # You specified exact version here
"scikit-learn",
"werkzeug",
"python-multipart",
"langgraph",
"tiktoken",
"langchainhub",
"chromadb",
"langchain",
"langchain-text-splitters",
"beautifulsoup4",
"langchain-core",
"PyPDF2",
"reportlab",
"python-docx"
]
# Get all installed packages with versions
result = subprocess.run(["pip", "freeze"], capture_output=True, text=True)
installed_packages = result.stdout.strip().split('\n')
# Create a dictionary of package names to their full name with version
package_dict = {}
for pkg in installed_packages:
if '==' in pkg:
name = pkg.split('==')[0].lower()
package_dict[name] = pkg
# Write only the requested packages to requirements.txt
with open('requirements.txt', 'w') as f:
for package in packages:
# Handle cases where version is already specifixed
if '==' in package:
f.write(f"{package}\n")
continue
# Try to find the package in installed packages
pkg_name = package.lower()
if pkg_name in package_dict:
f.write(f"{package_dict[pkg_name]}\n")
else:
# If not found, just write the package name
f.write(f"{package}\n")
print(f"Warning: {package} not found in installed packages")
print("requirements.txt has been generated.")
from utils.document_loader import load_document
tp =r"/Users/macbook/Downloads/094103543554Jobs - Volunteer experience V2 (1) (1).docx"
dc = load_document(file_path=tp)
print(dc)