File size: 763 Bytes
529d20c 47afa67 0becee4 529d20c 0becee4 1504b46 0becee4 47afa67 0becee4 47afa67 0becee4 529d20c bec374d 0becee4 bec374d 0becee4 d6f0faf bec374d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
import gradio as gr
import subprocess
import os
def download_model():
# 创建目录 ./trained/wdlm/,如果不存在的话
subprocess.run(["mkdir", "-p", "./trained/wdlm/"])
# 切换到目录 ./trained/wdlm/
os.chdir("./trained/wdlm/")
# 下载模型文件
subprocess.run(["wget", "-O", "G_38400.pth", "https://github.com/00000000002/render/releases/download/ddd/G_38400.pth"])
print("模型下载完成!")
iface = gr.Interface(fn=download_model, inputs="None", outputs="None", live=True)
download_button = gr.Button(download_model, "下载模型")
download_button.style.justify_content = "center" # 垂直居中
download_button.style.width = "200px" # 设置按钮宽度
iface.add_element(download_button)
iface.launch()
|