Update app.py
Browse files
app.py
CHANGED
@@ -6,7 +6,7 @@ from docx import Document
|
|
6 |
def wd(x):
|
7 |
doc=Document(x)
|
8 |
all_paragraphs = document.paragraphs
|
9 |
-
t=
|
10 |
return t
|
11 |
|
12 |
demo=gr.Blocks(css="#jsc:hover{background-color: red;}")
|
@@ -14,7 +14,7 @@ with demo:
|
|
14 |
with gr.Tabs():
|
15 |
with gr.TabItem("读取word"):
|
16 |
file_input = gr.File(file_count="single",label="请选择需要读取的word文件",show_label=True)
|
17 |
-
text_output = gr.
|
18 |
dq_button = gr.Button("开始读取>>")
|
19 |
dq_button.click(wd, inputs=file_input, outputs=text_output,api_name="word-text")
|
20 |
|
|
|
6 |
def wd(x):
|
7 |
doc=Document(x)
|
8 |
all_paragraphs = document.paragraphs
|
9 |
+
t=all_paragraphs[0].text
|
10 |
return t
|
11 |
|
12 |
demo=gr.Blocks(css="#jsc:hover{background-color: red;}")
|
|
|
14 |
with gr.Tabs():
|
15 |
with gr.TabItem("读取word"):
|
16 |
file_input = gr.File(file_count="single",label="请选择需要读取的word文件",show_label=True)
|
17 |
+
text_output = gr.Textbox(label="输出读取文本",show_label=True)
|
18 |
dq_button = gr.Button("开始读取>>")
|
19 |
dq_button.click(wd, inputs=file_input, outputs=text_output,api_name="word-text")
|
20 |
|