Spaces:
Paused
Paused
Update app.py
Browse files
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"{
|
| 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 |
-
#
|
| 755 |
-
space_url = f"https://
|
| 756 |
-
return f"๋ฐฐํฌ ์๋ฃ!
|
| 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"):
|