seawolf2357 commited on
Commit
2e4283e
ยท
verified ยท
1 Parent(s): 9319937

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -5
app.py CHANGED
@@ -730,9 +730,10 @@ def deploy_to_huggingface(code: str):
730
 
731
  api = HfApi(token=token)
732
  space_name = generate_space_name()
 
733
 
734
  # Space ์ƒ์„ฑ
735
- repo_id = f"{api.whoami()['name']}/{space_name}"
736
  create_repo(
737
  repo_id,
738
  repo_type="space",
@@ -751,12 +752,13 @@ def deploy_to_huggingface(code: str):
751
  repo_type="space"
752
  )
753
 
754
- # ๋ฐฐํฌ๋œ URL ๋ฐ˜ํ™˜
755
- space_url = f"https://huggingface.co/spaces/{repo_id}"
756
- return f"๋ฐฐํฌ ์™„๋ฃŒ! ๋‹ค์Œ URL์—์„œ ํ™•์ธํ•˜์„ธ์š”: {space_url}"
757
 
758
  except Exception as e:
759
  return f"๋ฐฐํฌ ์ค‘ ์˜ค๋ฅ˜ ๋ฐœ์ƒ: {str(e)}"
 
760
 
761
  # Demo ์ธ์Šคํ„ด์Šค ์ƒ์„ฑ
762
  demo_instance = Demo()
@@ -824,8 +826,8 @@ with gr.Blocks(css_paths="app.css",theme=theme) as demo:
824
  clear_btn = antd.Button("Clear", type="default", size="large")
825
 
826
  # ๋ฐฐํฌ ๊ฒฐ๊ณผ๋ฅผ ํ‘œ์‹œํ•  ํ…์ŠคํŠธ ์˜์—ญ ์ถ”๊ฐ€
827
- deploy_result = gr.Textbox(label="๋ฐฐํฌ ๊ฒฐ๊ณผ", interactive=False)
828
 
 
829
 
830
  with antd.Col(span=24, md=16):
831
  with ms.Div(elem_classes="right_panel"):
 
730
 
731
  api = HfApi(token=token)
732
  space_name = generate_space_name()
733
+ username = api.whoami()['name']
734
 
735
  # Space ์ƒ์„ฑ
736
+ repo_id = f"{username}/{space_name}"
737
  create_repo(
738
  repo_id,
739
  repo_type="space",
 
752
  repo_type="space"
753
  )
754
 
755
+ # ์ƒˆ๋กœ์šด URL ํ˜•์‹์œผ๋กœ ๋ฐ˜ํ™˜
756
+ space_url = f"https://{username}-{space_name}.hf.space"
757
+ return f"""๋ฐฐํฌ ์™„๋ฃŒ! <a href="{space_url}" target="_blank" style="color: #1890ff; text-decoration: underline; cursor: pointer;">์—ฌ๊ธฐ๋ฅผ ํด๋ฆญํ•˜์—ฌ ์—ด๊ธฐ</a>"""
758
 
759
  except Exception as e:
760
  return f"๋ฐฐํฌ ์ค‘ ์˜ค๋ฅ˜ ๋ฐœ์ƒ: {str(e)}"
761
+
762
 
763
  # Demo ์ธ์Šคํ„ด์Šค ์ƒ์„ฑ
764
  demo_instance = Demo()
 
826
  clear_btn = antd.Button("Clear", type="default", size="large")
827
 
828
  # ๋ฐฐํฌ ๊ฒฐ๊ณผ๋ฅผ ํ‘œ์‹œํ•  ํ…์ŠคํŠธ ์˜์—ญ ์ถ”๊ฐ€
 
829
 
830
+ deploy_result = gr.HTML(label="๋ฐฐํฌ ๊ฒฐ๊ณผ")
831
 
832
  with antd.Col(span=24, md=16):
833
  with ms.Div(elem_classes="right_panel"):