You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importgradioasgrimporttimedefhtml_works():
history= []
history.append(["",None])
text_to_show_in_chatbot='**testing** normal md <br> <table border="1" style="width:100%"><tr><th>Label</th><th>Value</th></tr><tr><th>x</th><th>y</th></tr>'response= [(text_to_show_in_chatbot, None)]
forletterinresponse[0][0]:
history[-1][0] +=lettertime.sleep(0.01)
yieldhistoryreturnresponsedefdataframe_does_not_work():
history= []
history.append(["",None])
df_to_show_in_chatbot=gr.DataFrame( # gr.Markdown neither workheaders=["name", "age", "gender"],
datatype=["str", "number", "str"],
col_count=(3, "fixed"),
type='array'## returning as an array / list of lists also okay, I can convert it to normal markdown but I also don't get any output as a list
)
print(f'{type(df_to_show_in_chatbot) =}')
response= [(df_to_show_in_chatbot, None)]
forletterinresponse[0][0]:
history[-1][0] +=lettertime.sleep(0.01)
yieldhistoryreturnresponsewithgr.Blocks() asdemo:
button=gr.Button()
chatbot=gr.Chatbot(render_markdown=True)
# button.click(html_works, outputs = chatbot) button.click(dataframe_does_not_work, outputs=chatbot)
demo.queue(default_concurrency_limit=None)
demo.launch()
The text was updated successfully, but these errors were encountered:
I believe gr.Markdown is supported but gr.DataFrame is not supported. @dawoodkhan82 can you confirm? Also we should have a helpful error if an unsupported component is used in the output.
I believe gr.Markdown is supported but gr.DataFrame is not supported. @dawoodkhan82 can you confirm? Also we should have a helpful error if an unsupported component is used in the output.
I get TypeError: 'Markdown' object is not iterable
@sglbl@abidlabs as of now "gallery" | "plot" | "audio" | "video" | "image" | html are supported components in the chatbot. there's already progress on adding other components which will be supported soon. markdown and dataframe are on that list.
Is your feature request related to a problem? Please describe.
I want to use gr.DataFrame in output of chatbot.
Describe the solution you'd like
Show the result of gr.DataFrame as a table inside chatbot result.
Additional context
gradio.__version__: '4.37.1'
Code:
The text was updated successfully, but these errors were encountered: