Yoyo2004 commited on
Commit
ca4ea75
·
verified ·
1 Parent(s): 1ccf718

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -1,8 +1,8 @@
1
  import os
2
  import time
3
  import math
4
- import html as py_html # ✅ 为了转义全文文本
5
  import gradio as gr
 
6
  from gradio_client import Client
7
 
8
  # ==========================================
@@ -180,6 +180,7 @@ body, .gradio-container {
180
  .fulltext-area {
181
  width: 100%;
182
  min-height: 500px;
 
183
  border-radius: 8px;
184
  border: 1px solid #e2e8f0;
185
  padding: 10px;
@@ -200,7 +201,7 @@ body, .gradio-container {
200
  # 2. 逻辑处理
201
  # ==========================================
202
 
203
- def paginate_story(story_data, chars_per_page=1200, first_page_ratio=0.8):
204
  """
205
  分章 -> 分页。
206
  - 首章首页可用字符数 = chars_per_page * first_page_ratio(因为有大标题和空白)
@@ -551,7 +552,7 @@ with gr.Blocks(
551
  persona_output,
552
  story_pages_state,
553
  chapter_indices_state,
554
- full_text_html, # ✅ 新增:全文导出 HTML
555
  story_display
556
  ],
557
  concurrency_limit=1
 
1
  import os
2
  import time
3
  import math
 
4
  import gradio as gr
5
+ import html as py_html
6
  from gradio_client import Client
7
 
8
  # ==========================================
 
180
  .fulltext-area {
181
  width: 100%;
182
  min-height: 500px;
183
+ height: 900px;
184
  border-radius: 8px;
185
  border: 1px solid #e2e8f0;
186
  padding: 10px;
 
201
  # 2. 逻辑处理
202
  # ==========================================
203
 
204
+ def paginate_story(story_data, chars_per_page=1000, first_page_ratio=0.8):
205
  """
206
  分章 -> 分页。
207
  - 首章首页可用字符数 = chars_per_page * first_page_ratio(因为有大标题和空白)
 
552
  persona_output,
553
  story_pages_state,
554
  chapter_indices_state,
555
+ full_text_html,
556
  story_display
557
  ],
558
  concurrency_limit=1