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

fix a bug with web_demo_streamlit_2.5.py at text mode #278

Closed
wants to merge 1 commit into from

Conversation

RainYooSuki
Copy link

@RainYooSuki RainYooSuki commented Jun 17, 2024

fix a bug with web_demo_streamlit_2.5:when use streamlit and chat in text mode,it would show an error. i found that when the text mode is chosed,the demo would still try to upload an image though there is not any image i upload. i fix it by adding 'image=none' instead of 'image=imagefile' when it is text mode and now it can use without any error.

原来的streamlit demo代码有问题,text模式下还会去读取image,导致一聊天就报错。看了下源码,在text模式下还会去尝试读上传的图🤨,解决办法就是加上一段if判断,当处于text模式的时候,image返回none就不报错了,实测也是可以正常对话了

fix a bug with web_demo_streamlit_2.5:when use streamlit and chat in text mode,it would show an error.
i found that when the text mode is choused,the demo would still try to upload an image though there is not any image i upload.
i fix it by adding 'image=none' instead of 'image=imagefile' when it is text mode and now it can use without any error.
@RainYooSuki
Copy link
Author

可能其他demo也会有这个问题,不过我用的是minicpm 2.5,所以就只改了streamlit 2.5的demo,其他的我没试不清楚,如果官方看到了去看看呗,结尾model.chat那段前面加个if selected_mode == "Image":判断就好了,else情况下res = model.chat(image=None,...

@RainYooSuki
Copy link
Author

CN SVQ~ 75%V7GAO~AQ EX3
这是改好后的效果

@RainYooSuki RainYooSuki changed the title fix a bug with web_demo_streamlit_2.5 fix a bug with web_demo_streamlit_2.5.py Jun 18, 2024
@RainYooSuki RainYooSuki changed the title fix a bug with web_demo_streamlit_2.5.py fix a bug with web_demo_streamlit_2.5.py at text mode Jun 18, 2024
@RainYooSuki RainYooSuki closed this by deleting the head repository Oct 30, 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

Successfully merging this pull request may close these issues.

1 participant