lhoestq HF staff commited on
Commit
16cc948
·
1 Parent(s): 4c1f027

use SPACE_ID

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -20,8 +20,8 @@ NUM_TRENDING_DATASETS = 10
20
  NUM_USER_DATASETS = 10
21
  SESSIONS_DIR = "s"
22
  SESSION_DIR_SPACES_SYMLINK = os.path.join("/data", SESSIONS_DIR)
23
- SPACE_REPO_NAME = os.getenv("SPACE_REPO_NAME")
24
- URL = f"https://huggingface.co/spaces/{SPACE_REPO_NAME}" if SPACE_REPO_NAME else "http://127.0.0.1:7870"
25
  css = """
26
  .transparent-dropdown, .transparent-dropdown .container .wrap, .transparent-accordion {
27
  background: var(--body-background-fill);
@@ -188,7 +188,7 @@ with gr.Blocks(css=css) as demo:
188
 
189
 
190
  if __name__ == "__main__":
191
- if SPACE_REPO_NAME:
192
  os.makedirs(SESSION_DIR_SPACES_SYMLINK, exist_ok=True)
193
  try:
194
  os.symlink(SESSION_DIR_SPACES_SYMLINK, SESSIONS_DIR, target_is_directory=True)
 
20
  NUM_USER_DATASETS = 10
21
  SESSIONS_DIR = "s"
22
  SESSION_DIR_SPACES_SYMLINK = os.path.join("/data", SESSIONS_DIR)
23
+ SPACE_ID = os.getenv("SPACE_ID")
24
+ URL = f"https://huggingface.co/spaces/{SPACE_ID}" if SPACE_ID else "http://127.0.0.1:7870"
25
  css = """
26
  .transparent-dropdown, .transparent-dropdown .container .wrap, .transparent-accordion {
27
  background: var(--body-background-fill);
 
188
 
189
 
190
  if __name__ == "__main__":
191
+ if SPACE_ID:
192
  os.makedirs(SESSION_DIR_SPACES_SYMLINK, exist_ok=True)
193
  try:
194
  os.symlink(SESSION_DIR_SPACES_SYMLINK, SESSIONS_DIR, target_is_directory=True)