fix
Browse files8578 unmodified lines8579858085818582858385848585115 unmodified lines8701870287038704870587068707118 unmodified lines882688278828882988308831883229 unmodified lines88628863886488658866886788688578 unmodified lineserror_prefix = "Error duplicating Streamlit space" if not is_update else "Error updating Streamlit space"return gr.update(value=f"{error_prefix}: {e}", visible=True)# Transformers.js logicelif sdk_name == "Transformers.js":try:# For new spaces, duplicate the template. For updates, just verify access.if not is_update:115 unmodified linesaction_verb = "updating" if is_update else "duplicating"return gr.update(value=f"Error {action_verb} Transformers.js space: {error_msg}", visible=True)# Svelte logicelif sdk_name == "Svelte":try:actual_repo_id = repo_id# For new spaces, duplicate the template first118 unmodified linesimport os# Upload temporary media files to HF and replace URLs (only for Static HTML, not Transformers.js)if sdk == "static" and sdk_name == "Static (HTML)":print("[Deploy] Uploading temporary media files to HF and updating URLs for multi-file static HTML app")# Update the index.html file with permanent media URLsif 'index.html' in files:29 unmodified linesfile_name = "index.html"# Upload temporary media files to HF and replace URLs (only for Static HTML, not Transformers.js)if sdk == "static" and sdk_name == "Static (HTML)":print("[Deploy] Uploading temporary media files to HF and updating URLs for single-file static HTML app")code = upload_temp_files_to_hf_and_replace_urls(code, token)8578 unmodified lines8579858085818582858385848585115 unmodified lines8701870287038704870587068707118 unmodified lines882688278828882988308831883229 unmodified lines88628863886488658866886788688578 unmodified lineserror_prefix = "Error duplicating Streamlit space" if not is_update else "Error updating Streamlit space"return gr.update(value=f"{error_prefix}: {e}", visible=True)# Transformers.js logicelif language == "transformers.js":try:# For new spaces, duplicate the template. For updates, just verify access.if not is_update:115 unmodified linesaction_verb = "updating" if is_update else "duplicating"return gr.update(value=f"Error {action_verb} Transformers.js space: {error_msg}", visible=True)# Svelte logicelif language == "svelte":try:actual_repo_id = repo_id# For new spaces, duplicate the template first118 unmodified linesimport os# Upload temporary media files to HF and replace URLs (only for Static HTML, not Transformers.js)if sdk == "static" and language == "html":print("[Deploy] Uploading temporary media files to HF and updating URLs for multi-file static HTML app")# Update the index.html file with permanent media URLsif 'index.html' in files:29 unmodified linesfile_name = "index.html"# Upload temporary media files to HF and replace URLs (only for Static HTML, not Transformers.js)if sdk == "static" and language == "html":print("[Deploy] Uploading temporary media files to HF and updating URLs for single-file static HTML app")code = upload_temp_files_to_hf_and_replace_urls(code, token)
app.py+4-4