mirror of
https://github.com/hiyouga/LLaMA-Factory.git
synced 2025-12-30 02:30:35 +08:00
[model] support audio (#6701)
* support qwen2_audio * improve code * lint * fix * fix * fix --------- Co-authored-by: hiyouga <hiyouga@buaa.edu.cn> Former-commit-id: 5eacb5629e4d7733cd992a63747a1335f2c6a929
This commit is contained in:
@@ -64,10 +64,13 @@ def create_chat_box(
|
||||
|
||||
with gr.Column() as mm_box:
|
||||
with gr.Tab("Image"):
|
||||
image = gr.Image(sources=["upload"], type="pil")
|
||||
image = gr.Image(type="pil")
|
||||
|
||||
with gr.Tab("Video"):
|
||||
video = gr.Video(sources=["upload"])
|
||||
video = gr.Video()
|
||||
|
||||
with gr.Tab("Audio"):
|
||||
audio = gr.Audio(type="filepath")
|
||||
|
||||
query = gr.Textbox(show_label=False, lines=8)
|
||||
submit_btn = gr.Button(variant="primary")
|
||||
@@ -86,7 +89,7 @@ def create_chat_box(
|
||||
[chatbot, messages, query],
|
||||
).then(
|
||||
engine.chatter.stream,
|
||||
[chatbot, messages, lang, system, tools, image, video, max_new_tokens, top_p, temperature],
|
||||
[chatbot, messages, lang, system, tools, image, video, audio, max_new_tokens, top_p, temperature],
|
||||
[chatbot, messages],
|
||||
)
|
||||
clear_btn.click(lambda: ([], []), outputs=[chatbot, messages])
|
||||
@@ -102,6 +105,7 @@ def create_chat_box(
|
||||
mm_box=mm_box,
|
||||
image=image,
|
||||
video=video,
|
||||
audio=audio,
|
||||
query=query,
|
||||
submit_btn=submit_btn,
|
||||
max_new_tokens=max_new_tokens,
|
||||
|
||||
Reference in New Issue
Block a user