Felladrin commited on
Commit
d581710
·
verified ·
1 Parent(s): db5b70b

Pass only the HF_TOKEN to the subprocess, which might be required for the script to download gated models

Browse files
Files changed (1) hide show
  1. app.py +3 -7
app.py CHANGED
@@ -57,12 +57,6 @@ class Config:
57
  is_using_user_token=bool(user_token),
58
  )
59
 
60
- def get_env_vars(self) -> Dict[str, str]:
61
- """Get environment variables with HF_TOKEN set appropriately."""
62
- env_vars = os.environ.copy()
63
- env_vars["HF_TOKEN"] = self.hf_token
64
- return env_vars
65
-
66
 
67
  class ModelConverter:
68
  """Handles model conversion and upload operations."""
@@ -128,7 +122,9 @@ class ModelConverter:
128
  cwd=self.config.repo_path,
129
  capture_output=True,
130
  text=True,
131
- env=self.config.get_env_vars(),
 
 
132
  )
133
 
134
  def convert_model(
 
57
  is_using_user_token=bool(user_token),
58
  )
59
 
 
 
 
 
 
 
60
 
61
  class ModelConverter:
62
  """Handles model conversion and upload operations."""
 
122
  cwd=self.config.repo_path,
123
  capture_output=True,
124
  text=True,
125
+ env={
126
+ "HF_TOKEN": self.config.hf_token,
127
+ },
128
  )
129
 
130
  def convert_model(