使用 gradio 自带复制到剪贴板功能
This commit is contained in:
parent
6cdabb5005
commit
acd7853986
@ -2,8 +2,6 @@ import gradio as gr
|
|||||||
import subprocess
|
import subprocess
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import clipman
|
|
||||||
clipman.init()
|
|
||||||
|
|
||||||
|
|
||||||
def convert_to_wav(audio_file):
|
def convert_to_wav(audio_file):
|
||||||
@ -204,18 +202,14 @@ with gr.Blocks() as iface:
|
|||||||
with gr.Tab("下载pdf"):
|
with gr.Tab("下载pdf"):
|
||||||
gr.Markdown("## pdf 下载指令修复")
|
gr.Markdown("## pdf 下载指令修复")
|
||||||
with gr.Row():
|
with gr.Row():
|
||||||
with gr.Column():
|
power_shell_text_input = gr.Textbox(lines=10, placeholder="请在此输入power shell 脚本...")
|
||||||
power_shell_text_input = gr.Textbox(lines=15, placeholder="请在此输入power shell 脚本...")
|
with gr.Row():
|
||||||
with gr.Column():
|
power_shell_pdf_button = gr.Button("转换")
|
||||||
power_shell_pdf_button = gr.Button("转换")
|
with gr.Row():
|
||||||
power_shell_pdf_copy_button = gr.Button("复制")
|
power_shell_text_output = gr.Textbox(lines=10, placeholder="这里会显示结果", show_copy_button=True)
|
||||||
status_text = gr.Textbox(label="Status")
|
|
||||||
with gr.Column():
|
|
||||||
power_shell_text_output = gr.Textbox(lines=15, placeholder="这里会显示结果")
|
|
||||||
|
|
||||||
power_shell_pdf_button.click(power_shell_pdf_download, inputs=power_shell_text_input,
|
power_shell_pdf_button.click(power_shell_pdf_download, inputs=power_shell_text_input,
|
||||||
outputs=power_shell_text_output)
|
outputs=power_shell_text_output)
|
||||||
power_shell_pdf_copy_button.click(fn=copy_text, inputs=power_shell_text_output, outputs=status_text)
|
|
||||||
|
|
||||||
iface.load(fn=update_log_output, outputs=[log_output], every=1)
|
iface.load(fn=update_log_output, outputs=[log_output], every=1)
|
||||||
|
|
||||||
|
|||||||
@ -1,2 +1 @@
|
|||||||
gradio==4.44.0
|
gradio==4.44.0
|
||||||
clipman~=3.3.1
|
|
||||||
Loading…
x
Reference in New Issue
Block a user