SushantGautam commited on
Commit
3a12f0c
·
1 Parent(s): 2d55c6e

Add Hugging Face token support for database download in WSGI and manage.py

Browse files
Files changed (3) hide show
  1. BridgeMentor/wsgi.py +3 -1
  2. Dockerfile +0 -2
  3. manage.py +2 -1
BridgeMentor/wsgi.py CHANGED
@@ -25,7 +25,9 @@ if os.environ.get('INSIDEDOCKER'):
25
  repo_id="SushantGautam/BridgeMentor",
26
  filename="db.sqlite3",
27
  repo_type="dataset",
28
- cache_dir=custom_cache_dir
 
 
29
  )
30
  print(f"Downloaded to: {file_path}")
31
  destination_path = os.path.join(os.getcwd(), "db.sqlite3")
 
25
  repo_id="SushantGautam/BridgeMentor",
26
  filename="db.sqlite3",
27
  repo_type="dataset",
28
+ cache_dir=custom_cache_dir,
29
+ token=os.getenv("HF_TOKEN"),
30
+
31
  )
32
  print(f"Downloaded to: {file_path}")
33
  destination_path = os.path.join(os.getcwd(), "db.sqlite3")
Dockerfile CHANGED
@@ -21,8 +21,6 @@ WORKDIR /app
21
  # Install Python dependencies (cached as long as requirements.txt doesn't change)
22
  COPY requirements.txt .
23
  RUN pip install --upgrade pip && pip install -r requirements.txt
24
- RUN huggingface-cli login --token $HF_TOKEN
25
-
26
 
27
  # Copy project files (this step is later to allow caching of pip install)
28
  COPY . .
 
21
  # Install Python dependencies (cached as long as requirements.txt doesn't change)
22
  COPY requirements.txt .
23
  RUN pip install --upgrade pip && pip install -r requirements.txt
 
 
24
 
25
  # Copy project files (this step is later to allow caching of pip install)
26
  COPY . .
manage.py CHANGED
@@ -19,7 +19,8 @@ if os.environ.get('INSIDEDOCKER'):
19
  repo_id="SushantGautam/BridgeMentor",
20
  filename="db.sqlite3",
21
  repo_type="dataset",
22
- cache_dir=custom_cache_dir
 
23
  )
24
  print(f"Downloaded to: {file_path}")
25
  destination_path = os.path.join(os.getcwd(), "db.sqlite3")
 
19
  repo_id="SushantGautam/BridgeMentor",
20
  filename="db.sqlite3",
21
  repo_type="dataset",
22
+ cache_dir=custom_cache_dir,
23
+ token=os.getenv("HF_TOKEN"),
24
  )
25
  print(f"Downloaded to: {file_path}")
26
  destination_path = os.path.join(os.getcwd(), "db.sqlite3")