Spaces:
Runtime error
Runtime error
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
|
| 3 |
+
def dummy_translate(pdf_file):
|
| 4 |
+
return "目前只是一个占位函数,稍后实现真正翻译逻辑。"
|
| 5 |
+
|
| 6 |
+
with gr.Blocks() as demo:
|
| 7 |
+
gr.Markdown("# PDF 英文翻译器(开发中)")
|
| 8 |
+
|
| 9 |
+
with gr.Row():
|
| 10 |
+
pdf_input = gr.File(label="上传英文 PDF 文件", file_types=[".pdf"])
|
| 11 |
+
|
| 12 |
+
translate_button = gr.Button("开始翻译")
|
| 13 |
+
output_text = gr.Textbox(label="翻译后内容", lines=10)
|
| 14 |
+
|
| 15 |
+
translate_button.click(fn=dummy_translate, inputs=pdf_input, outputs=output_text)
|
| 16 |
+
|
| 17 |
+
demo.launch()
|