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

ChatInterface的additional_inputs参数怎么做才不被折叠? #8176

Closed
1 task done
Jacoo520 opened this issue Apr 30, 2024 · 3 comments
Closed
1 task done

ChatInterface的additional_inputs参数怎么做才不被折叠? #8176

Jacoo520 opened this issue Apr 30, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@Jacoo520
Copy link

Jacoo520 commented Apr 30, 2024

Describe the bug

  • 我正在做一个聊天界面,增加个下拉菜单,但是这个下拉菜单显示的时候是被折叠的,文档写的“如果组件尚未在周围的块中渲染,则组件将以折叠形式显示在聊天机器人下方”,可能是我没理解过来,实在不知道怎么做,我只想要下拉菜单正常显示在布局里,而不是默认被折叠起来,请求帮助!!
  • 然后是否可以将附加的下拉菜单组件排版在最上面?

Have you searched existing issues? 🔎

  • I have searched and found no existing issues

Reproduction

部分代码:

model_list = ['llama2','llama3','gemma','llava','codellama','wizardlm2']
tab6 = gr.ChatInterface(fn = ollama_ai,
                        chatbot = gr.Chatbot(label = "流行大模型聊天"),
                        textbox= gr.Textbox(placeholder = "请输入你的问题",container=False),
                        additional_inputs = gr.Dropdown(choices=model_list,label='请选择模型'),
                        submit_btn = "发送",
                        clear_btn = "清除",
                        stop_btn = "停止",
                        undo_btn = "撤销",
                        retry_btn = "重试",
                        title = "AI聊天",
                        description=  "这是可以选择不同模型的聊天机器人,欢迎您的使用。")

Screenshot

1714475435976

Logs

No response

System Info

gradio: 4.24.0

Severity

I can work around it

@Jacoo520 Jacoo520 added the bug Something isn't working label Apr 30, 2024
@abidlabs
Copy link
Member

Hi @Jacoo520 we require all issues to be submitted in English so that the team can understand and debug. Can you please translate the issue and we can reopen? Also can you please provide a standalone minimal code example that we can use to reproduce the issue above? See: https://stackoverflow.com/help/minimal-reproducible-example

@abidlabs abidlabs closed this as not planned Won't fix, can't repro, duplicate, stale Apr 30, 2024
@Jacoo520
Copy link
Author

Jacoo520 commented May 1, 2024

嗨,我们要求所有问题都用英语提交,以便团队能够理解和调试。你能翻译一下这个问题,我们可以重新开放吗?另外,您能否提供一个独立的最小代码示例,我们可以用它来重现上述问题?请参见:https://stackoverflow.com/help/minimal-reproducible-example

I'm working on a chat interface to add a drop-down menu, but this drop-down menu is collapsed when it is displayed, I just want the drop-down menu to be displayed in the layout normally, not collapsed by default, and is it possible to put the additional drop-down menu components on top? or can this layout only be done using Blocks?

@abidlabs
Copy link
Member

abidlabs commented May 1, 2024

You can combine Blocks and ChatInterface to get this effect, e.g.

import gradio as gr

with gr.Blocks() as demo:
    dropdown = gr.Dropdown(["a", "b"])
    gr.ChatInterface(lambda x,y,z:x+z, additional_inputs=dropdown)
    
demo.launch()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants