SushantGautam commited on
Commit
0a9c507
·
1 Parent(s): 3a12f0c

Remove Hugging Face token from database download in manage.py and streamline Dockerfile login command

Browse files
Files changed (3) hide show
  1. BridgeMentor/wsgi.py +1 -3
  2. Dockerfile +1 -0
  3. manage.py +1 -2
BridgeMentor/wsgi.py CHANGED
@@ -25,9 +25,7 @@ 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
- token=os.getenv("HF_TOKEN"),
30
-
31
  )
32
  print(f"Downloaded to: {file_path}")
33
  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
  )
30
  print(f"Downloaded to: {file_path}")
31
  destination_path = os.path.join(os.getcwd(), "db.sqlite3")
Dockerfile CHANGED
@@ -21,6 +21,7 @@ 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
 
25
  # Copy project files (this step is later to allow caching of pip install)
26
  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
+ RUN huggingface-cli login --token ${HF_TOKEN}
25
 
26
  # Copy project files (this step is later to allow caching of pip install)
27
  COPY . .
manage.py CHANGED
@@ -19,8 +19,7 @@ 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
- token=os.getenv("HF_TOKEN"),
24
  )
25
  print(f"Downloaded to: {file_path}")
26
  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
  )
24
  print(f"Downloaded to: {file_path}")
25
  destination_path = os.path.join(os.getcwd(), "db.sqlite3")