first commit

This commit is contained in:
2024-07-02 13:54:57 +08:00
commit 04a83926d7
112 changed files with 13631 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
from gradio_client import Client
import wave
import os
client = Client("http://127.0.0.1:7860/")
result = client.predict(
"试一下效果怎么样?你好这是一个测试音频,实现了api音频实时输出",
"example",
"简体中文",
0.8,
fn_index=0
)
print(result)
# 获取当前目录
current_dir = os.getcwd()
# 构建目标文件路径
target_file_path = os.path.join(current_dir, 'audio.wav')
print(target_file_path)
# 复制文件到当前目录
with open(result[1], 'rb') as source_file:
with open(target_file_path, 'wb') as target_file:
target_file.write(source_file.read())