coollsd commited on
Commit
6cf5ede
·
verified ·
1 Parent(s): 3bf0273

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -15,8 +15,10 @@ def upload_and_share(file):
15
  f.write(file.read())
16
 
17
  # Generate a shareable link
18
- share_link = gr.File.create_share_link(file_path)
19
- return f"File uploaded successfully. Shareable link: {share_link}"
 
 
20
 
21
  with gr.Blocks() as demo:
22
  file_input = gr.File(label="Upload File")
 
15
  f.write(file.read())
16
 
17
  # Generate a shareable link
18
+ base_url = "https://coollsd-test.hf.space"
19
+ relative_path = file_path.replace("/tmp", "")
20
+ share_link = f"{base_url}/file={relative_path}"
21
+ return share_link
22
 
23
  with gr.Blocks() as demo:
24
  file_input = gr.File(label="Upload File")