Update app.py
Browse files
app.py
CHANGED
@@ -19,20 +19,20 @@ def clone_repo():
|
|
19 |
# クローンを実行
|
20 |
clone_repo()
|
21 |
|
22 |
-
#
|
23 |
def display_index():
|
24 |
-
# index.htmlをHTMLとして読み込む
|
25 |
with open("index.html", "r") as file:
|
26 |
html_content = file.read()
|
27 |
return html_content
|
28 |
|
29 |
-
# Gradio
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
)
|
36 |
|
|
|
37 |
if __name__ == "__main__":
|
38 |
-
|
|
|
19 |
# クローンを実行
|
20 |
clone_repo()
|
21 |
|
22 |
+
# index.htmlの内容を読み込む関数
|
23 |
def display_index():
|
|
|
24 |
with open("index.html", "r") as file:
|
25 |
html_content = file.read()
|
26 |
return html_content
|
27 |
|
28 |
+
# Gradioアプリの設定
|
29 |
+
with gr.Blocks() as app:
|
30 |
+
# `HTML`コンポーネントで`index.html`の内容を表示
|
31 |
+
html_display = gr.HTML()
|
32 |
+
|
33 |
+
# ページロード時にdisplay_indexを自動実行
|
34 |
+
app.load(display_index, outputs=html_display)
|
35 |
|
36 |
+
# Gradioアプリを起動
|
37 |
if __name__ == "__main__":
|
38 |
+
app.launch()
|