theguywhosucks commited on
Commit
438c3dc
·
verified ·
1 Parent(s): 9975a15

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -105,7 +105,7 @@ def download_file(user_id, password, filename):
105
  temp_name = f"{uuid.uuid4()}_{filename}"
106
  temp_path = os.path.join(TMP_DIR, temp_name)
107
 
108
- wget_cmd = [
109
  "wget",
110
  "--tries=3",
111
  "--no-check-certificate",
@@ -115,9 +115,9 @@ def download_file(user_id, password, filename):
115
  ]
116
 
117
  if HF_TOKEN:
118
- wget_cmd.insert(1, f"--header=Authorization: Bearer {HF_TOKEN}")
119
 
120
- subprocess.run(wget_cmd, check=True)
121
 
122
  return f"{SPACE_URL}/file={temp_path}"
123
 
@@ -243,4 +243,5 @@ with gr.Blocks(title="Pockit Cloud Client") as app:
243
  outputs=change_status
244
  )
245
 
246
- app.launch()
 
 
105
  temp_name = f"{uuid.uuid4()}_{filename}"
106
  temp_path = os.path.join(TMP_DIR, temp_name)
107
 
108
+ cmd = [
109
  "wget",
110
  "--tries=3",
111
  "--no-check-certificate",
 
115
  ]
116
 
117
  if HF_TOKEN:
118
+ cmd.insert(1, f"--header=Authorization: Bearer {HF_TOKEN}")
119
 
120
+ subprocess.run(cmd, check=True)
121
 
122
  return f"{SPACE_URL}/file={temp_path}"
123
 
 
243
  outputs=change_status
244
  )
245
 
246
+ # IMPORTANT: allow tmp folder
247
+ app.launch(allowed_paths=[TMP_DIR])