gradio-app / gradio

Build and share delightful machine learning apps, all in Python. 🌟 Star to support our work!
http://www.gradio.app
Apache License 2.0
34.5k stars 2.62k forks source link

Chatbot avatar image not loading in chatbot_multimodal demo #6329

Closed freddyaboulton closed 1 year ago

freddyaboulton commented 1 year ago

Describe the bug

The chatbot avatar image is not loading

Have you searched existing issues? 🔎

Reproduction

send a message to the bot in the chatbot_multimodal demo and observe the avatar image.

Screenshot

image

Logs

No response

System Info

Gradio Environment Information:
------------------------------
Operating System: Darwin
gradio version: 4.1.1
gradio_client version: 0.7.0

------------------------------------------------
gradio dependencies in your environment:

aiofiles: 23.1.0
altair: 5.0.1
fastapi: 0.100.0
ffmpy: 0.3.0
gradio-client==0.7.0 is not installed.
httpx: 0.24.1
huggingface-hub: 0.16.4
importlib-resources: 6.1.1
jinja2: 3.1.2
markupsafe: 2.1.3
matplotlib: 3.7.2
numpy: 1.25.1
orjson: 3.9.2
packaging: 23.1
pandas: 2.0.3
pillow: 10.0.0
pydantic: 2.4.2
pydub: 0.25.1
python-multipart: 0.0.6
pyyaml: 6.0
requests: 2.31.0
semantic-version: 2.10.0
tomlkit==0.12.0 is not installed.
typer: 0.9.0
typing-extensions: 4.7.1
uvicorn: 0.22.0
websockets: 11.0.3
authlib; extra == 'oauth' is not installed.
itsdangerous; extra == 'oauth' is not installed.

gradio_client dependencies in your environment:

fsspec: 2023.6.0
httpx: 0.24.1
huggingface-hub: 0.16.4
packaging: 23.1
requests: 2.31.0
typing-extensions: 4.7.1
websockets: 11.0.3

Severity

I can work around it

abidlabs commented 1 year ago

Ah this is because of the new file policy. We'll need to move the avatar images to the cache as well

freddyaboulton commented 1 year ago

But the demo is setting allowed_paths?

abidlabs commented 1 year ago

Because allowed_paths is relative to the working directory, you have to run the demo from the demo/chatbot_multimodal/ folder for it to work:

image

And in the deployed Spaces, it doesn't work because there is a single launch() command for the entire collection of demos, which does not set allowed_paths

abidlabs commented 1 year ago

Anyways, a user shouldn't have to do this, the better thing would be to use move_resource_to_block_cache to move the avatar images

freddyaboulton commented 1 year ago

Gotcha. Problem was happening for me locally but I was also not running the demo from the same directory as the image.