soiz commited on
Commit
d7f832a
·
verified ·
1 Parent(s): 305b2db

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -10
app.py CHANGED
@@ -19,20 +19,20 @@ def clone_repo():
19
  # クローンを実行
20
  clone_repo()
21
 
22
- # Gradioアプリの作成
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
- iface = gr.Interface(
31
- fn=display_index,
32
- inputs=None,
33
- outputs="html",
34
- live=True
35
- )
36
 
 
37
  if __name__ == "__main__":
38
- iface.launch()
 
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()