openfree commited on
Commit
cf995f4
·
verified ·
1 Parent(s): 56c862a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +25 -11
app.py CHANGED
@@ -1,30 +1,41 @@
 
 
 
 
 
 
 
 
1
  <!DOCTYPE html>
2
  <html>
3
  <head>
4
  <style>
5
- /* We'll keep minimal direct CSS here, the rest will be handled in the Python script or internal Gradio style. */
 
 
 
6
  </style>
7
  </head>
8
  <body>
9
 
10
- <!-- Below is the updated Python script with the requested modifications. -->
11
-
12
  <!--
13
  NOTE:
14
  1. Removed the "좌측 상단 박스" and replaced it with option selectors at the top.
15
  2. Added four categories: 난이도, 게임 유형, 그래픽 스타일, 시점 뷰 as radio groups.
16
  3. The rest of the logic remains nearly identical, just reorganized in the layout.
17
- 4. Remember to adjust or add any resource files (e.g. images) to your environment as needed.
18
- 5. Code is wrapped in triple backticks with "html" as requested.
19
  -->
20
 
21
- <script type="module">
22
- /* Python code below is just textual, as we normally place it in a .py file or run with a Python environment.
23
- For demonstration, we embed it here in code fences. */
24
- </script>
 
 
 
 
 
25
 
26
- <pre>
27
- ```python
28
  import os
29
  import re
30
  import random
@@ -1049,9 +1060,12 @@ with gr.Blocks(css_paths="app.css", theme=theme) as demo:
1049
  outputs=[deploy_result]
1050
  )
1051
 
 
1052
  if __name__ == "__main__":
1053
  try:
1054
  demo_instance = Demo()
 
1055
  demo.queue(default_concurrency_limit=20).launch(ssr_mode=False)
1056
  except Exception as e:
 
1057
  raise
 
1
+ # app.py
2
+
3
+ ############################################
4
+ # (1) HTML을 그대로 남기고 싶다면, 아래와 같이 멀티라인 문자열로 묶어두고
5
+ # 파이썬 실행에 영향을 주지 않도록 처리합니다.
6
+ ############################################
7
+
8
+ html_header_for_reference = r"""
9
  <!DOCTYPE html>
10
  <html>
11
  <head>
12
  <style>
13
+ /*
14
+ We'll keep minimal direct CSS here,
15
+ the rest will be handled in the Python script or internal Gradio style.
16
+ */
17
  </style>
18
  </head>
19
  <body>
20
 
 
 
21
  <!--
22
  NOTE:
23
  1. Removed the "좌측 상단 박스" and replaced it with option selectors at the top.
24
  2. Added four categories: 난이도, 게임 유형, 그래픽 스타일, 시점 뷰 as radio groups.
25
  3. The rest of the logic remains nearly identical, just reorganized in the layout.
26
+ 4. Code is wrapped in triple backticks with "html" as requested.
 
27
  -->
28
 
29
+ <!-- for reference only, not used directly in code -->
30
+
31
+ </body>
32
+ </html>
33
+ """
34
+
35
+ ############################################
36
+ # (2) 이제부터는 실제 파이썬 코드 (Gradio 앱)입니다.
37
+ ############################################
38
 
 
 
39
  import os
40
  import re
41
  import random
 
1060
  outputs=[deploy_result]
1061
  )
1062
 
1063
+ # 실제 실행 부분
1064
  if __name__ == "__main__":
1065
  try:
1066
  demo_instance = Demo()
1067
+ # queue()를 통해 비동기 처리; ssr_mode=False는 서버-사이드 렌더링 비활성화
1068
  demo.queue(default_concurrency_limit=20).launch(ssr_mode=False)
1069
  except Exception as e:
1070
+ print(f"Initialization error: {e}")
1071
  raise