akhaliq HF Staff commited on
Commit
d014aea
·
1 Parent(s): 0f15899
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -1578,7 +1578,8 @@ with gr.Blocks(
1578
  exist_ok=True
1579
  )
1580
  print("Duplicated repo result:", duplicated_repo, type(duplicated_repo))
1581
-
 
1582
  # Parse the transformers.js output to get the three files
1583
  files = parse_transformers_js_output(code)
1584
 
@@ -1645,7 +1646,7 @@ with gr.Blocks(
1645
  os.unlink(temp_path)
1646
 
1647
  except Exception as e:
1648
- return gr.update(value=f"Error duplicating Transformers.js space: {e}", visible=True)
1649
  # Other SDKs (existing logic)
1650
  if sdk == "static":
1651
  file_name = "index.html"
 
1578
  exist_ok=True
1579
  )
1580
  print("Duplicated repo result:", duplicated_repo, type(duplicated_repo))
1581
+ # Show the duplicated space URL immediately for user feedback
1582
+ gr.update(value=f"✅ Space duplicated! [Open your new Space here]({str(duplicated_repo)})", visible=True)
1583
  # Parse the transformers.js output to get the three files
1584
  files = parse_transformers_js_output(code)
1585
 
 
1646
  os.unlink(temp_path)
1647
 
1648
  except Exception as e:
1649
+ return gr.update(value=f"Error duplicating Transformers.js space: {e}. If this is a RepoUrl object error, ensure you are not accessing a .url attribute and use str(duplicated_repo) for the URL.", visible=True)
1650
  # Other SDKs (existing logic)
1651
  if sdk == "static":
1652
  file_name = "index.html"