akhaliq HF Staff commited on
Commit
18a62e0
·
1 Parent(s): 2a96e6f
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -8579,7 +8579,7 @@ with gr.Blocks(
8579
  error_prefix = "Error duplicating Streamlit space" if not is_update else "Error updating Streamlit space"
8580
  return gr.update(value=f"{error_prefix}: {e}", visible=True)
8581
  # Transformers.js logic
8582
- elif sdk_name == "Transformers.js":
8583
  try:
8584
  # For new spaces, duplicate the template. For updates, just verify access.
8585
  if not is_update:
@@ -8701,7 +8701,7 @@ with gr.Blocks(
8701
  action_verb = "updating" if is_update else "duplicating"
8702
  return gr.update(value=f"Error {action_verb} Transformers.js space: {error_msg}", visible=True)
8703
  # Svelte logic
8704
- elif sdk_name == "Svelte":
8705
  try:
8706
  actual_repo_id = repo_id
8707
  # For new spaces, duplicate the template first
@@ -8826,7 +8826,7 @@ with gr.Blocks(
8826
  import os
8827
 
8828
  # Upload temporary media files to HF and replace URLs (only for Static HTML, not Transformers.js)
8829
- if sdk == "static" and sdk_name == "Static (HTML)":
8830
  print("[Deploy] Uploading temporary media files to HF and updating URLs for multi-file static HTML app")
8831
  # Update the index.html file with permanent media URLs
8832
  if 'index.html' in files:
@@ -8862,7 +8862,7 @@ with gr.Blocks(
8862
  file_name = "index.html"
8863
 
8864
  # Upload temporary media files to HF and replace URLs (only for Static HTML, not Transformers.js)
8865
- if sdk == "static" and sdk_name == "Static (HTML)":
8866
  print("[Deploy] Uploading temporary media files to HF and updating URLs for single-file static HTML app")
8867
  code = upload_temp_files_to_hf_and_replace_urls(code, token)
8868
 
 
8579
  error_prefix = "Error duplicating Streamlit space" if not is_update else "Error updating Streamlit space"
8580
  return gr.update(value=f"{error_prefix}: {e}", visible=True)
8581
  # Transformers.js logic
8582
+ elif language == "transformers.js":
8583
  try:
8584
  # For new spaces, duplicate the template. For updates, just verify access.
8585
  if not is_update:
 
8701
  action_verb = "updating" if is_update else "duplicating"
8702
  return gr.update(value=f"Error {action_verb} Transformers.js space: {error_msg}", visible=True)
8703
  # Svelte logic
8704
+ elif language == "svelte":
8705
  try:
8706
  actual_repo_id = repo_id
8707
  # For new spaces, duplicate the template first
 
8826
  import os
8827
 
8828
  # Upload temporary media files to HF and replace URLs (only for Static HTML, not Transformers.js)
8829
+ if sdk == "static" and language == "html":
8830
  print("[Deploy] Uploading temporary media files to HF and updating URLs for multi-file static HTML app")
8831
  # Update the index.html file with permanent media URLs
8832
  if 'index.html' in files:
 
8862
  file_name = "index.html"
8863
 
8864
  # Upload temporary media files to HF and replace URLs (only for Static HTML, not Transformers.js)
8865
+ if sdk == "static" and language == "html":
8866
  print("[Deploy] Uploading temporary media files to HF and updating URLs for single-file static HTML app")
8867
  code = upload_temp_files_to_hf_and_replace_urls(code, token)
8868