tstone87 commited on
Commit
4611fb0
·
verified ·
1 Parent(s): 75f0c72

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -19,19 +19,18 @@ CHUNK_SIZE = 2500 # Larger chunks for better context
19
  # 🔹 Ensure Directory Exists
20
  os.makedirs(PDF_DIR, exist_ok=True)
21
 
22
- # 🔹 Function to Download PDFs from Hugging Face Space
23
  def download_pdfs():
24
  pdf_files = [
25
  "SNAP 10 CCR 2506-1 .pdf",
26
  "Med 10 CCR 2505-10 8.100.pdf",
27
- # Add other PDFs here if necessary
28
  ]
29
 
30
  for pdf_file in pdf_files:
31
  pdf_path = os.path.join(PDF_DIR, pdf_file)
32
  if not os.path.exists(pdf_path): # Download if not already present
33
  print(f"📥 Downloading {pdf_file}...")
34
- hf_hub_download(repo_id=HF_REPO_ID, filename=pdf_file, local_dir=PDF_DIR)
35
 
36
  print("✅ All PDFs downloaded.")
37
 
 
19
  # 🔹 Ensure Directory Exists
20
  os.makedirs(PDF_DIR, exist_ok=True)
21
 
22
+ # 🔹 Function to Download PDFs from Hugging Face Space (Handles LFS Storage)
23
  def download_pdfs():
24
  pdf_files = [
25
  "SNAP 10 CCR 2506-1 .pdf",
26
  "Med 10 CCR 2505-10 8.100.pdf",
 
27
  ]
28
 
29
  for pdf_file in pdf_files:
30
  pdf_path = os.path.join(PDF_DIR, pdf_file)
31
  if not os.path.exists(pdf_path): # Download if not already present
32
  print(f"📥 Downloading {pdf_file}...")
33
+ hf_hub_download(repo_id=HF_REPO_ID, filename=pdf_file, local_dir=PDF_DIR, force_download=True)
34
 
35
  print("✅ All PDFs downloaded.")
36