Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

输入tokens转文本 #73

Open
panhu opened this issue Nov 6, 2024 · 4 comments
Open

输入tokens转文本 #73

panhu opened this issue Nov 6, 2024 · 4 comments
Assignees

Comments

@panhu
Copy link

panhu commented Nov 6, 2024

是否可以将音频输入的tokens转文本,输出语音识别的文本结果

@sixsixcoder
Copy link

输出中包含文本信息和语音编码的token信息,你可以hack输出然后进行二次开发

@panhu
Copy link
Author

panhu commented Nov 7, 2024

感谢回复,我想请问下,当glm_model需要生成的答案很长的话,需要等待较长时间才有答复。想请教的是glm_model是否是流式生成还是一次性生成

@sixsixcoder
Copy link

GLM-4-voice默认支持流式生成,你可以在文件model_server.py中找到,
处理返回的流式内容

@app.post("/generate_stream")
async def generate_stream(request: Request):
    params = await request.json()

    generator = worker.generate_stream_gate(params)
    return StreamingResponse(generator)

@panhu
Copy link
Author

panhu commented Nov 13, 2024

感谢回复,当我参考web_demo进行流式测试时,能感觉到明显的卡顿感,貌似是因为固定的batch_size,让流不流畅?不知道我理解的对不对?有没有更好的解决方法

@panhu panhu mentioned this issue Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants