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

Problem changing Chatbot text size in Blocks #6943

Closed
1 task done
ZQ-Dev8 opened this issue Jan 3, 2024 · 2 comments · Fixed by #6958
Closed
1 task done

Problem changing Chatbot text size in Blocks #6943

ZQ-Dev8 opened this issue Jan 3, 2024 · 2 comments · Fixed by #6958
Assignees
Labels
bug Something isn't working

Comments

@ZQ-Dev8
Copy link

ZQ-Dev8 commented Jan 3, 2024

Describe the bug

Reporting a potential bug where lowering the text size via gr.Blocks(theme = gr.themes.Default(text_size='sm',)) does not affect the size of the text in the chatbot. Oddly, this does work when increasing the text size to lg, but values of sm (and presumably lower) are ignored. See attached reproduction and screenshots for reference.

Have you searched existing issues? 🔎

  • I have searched and found no existing issues

Reproduction

import gradio as gr
import random
import time

# text_size='sm' is ignored (see screenshot 1) while text_size='lg' is obeyed (see screenshot 2)
with gr.Blocks(theme = gr.themes.Default(text_size='sm',)) as demo:
# with gr.Blocks(theme = gr.themes.Default(text_size='lg',)) as demo:
    chatbot = gr.Chatbot()
    msg = gr.Textbox()
    clear = gr.ClearButton([msg, chatbot])

    def respond(message, chat_history):
        bot_message = random.choice(["How are you?", "I love you", "I'm very hungry"])
        chat_history.append((message, bot_message))
        time.sleep(2)
        return "", chat_history

    msg.submit(respond, [msg, chatbot], [msg, chatbot])

if __name__ == "__main__":
    demo.launch()
    ```

### Screenshot

![ss1](https://github.com/gradio-app/gradio/assets/6372983/b35351c2-516c-4516-873f-d67a02301c39)
![ss2](https://github.com/gradio-app/gradio/assets/6372983/ac1c0b62-2199-49ee-851f-b2284fd72317)


### Logs

```shell
No error message to report.

System Info

Gradio Environment Information:
------------------------------
Operating System: Linux
gradio version: 4.11.0
gradio_client version: 0.7.3

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

aiofiles: 23.2.1
altair: 5.1.2
fastapi: 0.104.1
ffmpy: 0.3.1
gradio-client==0.7.3 is not installed.
httpx: 0.25.0
huggingface-hub: 0.19.4
importlib-resources: 6.1.0
jinja2: 3.1.2
markupsafe: 2.1.3
matplotlib: 3.8.1
numpy: 1.26.1
orjson: 3.9.10
packaging: 23.2
pandas: 2.1.2
pillow: 10.1.0
pydantic: 2.4.2
pydub: 0.25.1
python-multipart: 0.0.6
pyyaml: 6.0.1
semantic-version: 2.10.0
tomlkit==0.12.0 is not installed.
typer: 0.9.0
typing-extensions: 4.8.0
uvicorn: 0.23.2
authlib; extra == 'oauth' is not installed.
itsdangerous; extra == 'oauth' is not installed.


gradio_client dependencies in your environment:

fsspec: 2023.10.0
httpx: 0.25.0
huggingface-hub: 0.19.4
packaging: 23.2
typing-extensions: 4.8.0
websockets: 11.0.3


### Severity

I can work around it
@ZQ-Dev8 ZQ-Dev8 added the bug Something isn't working label Jan 3, 2024
@ZQ-Dev8
Copy link
Author

ZQ-Dev8 commented Jan 3, 2024

Issue derived from this brief HF Discord conversation, for reference - https://discord.com/channels/879548962464493619/1187532601225912430

@hannahblair
Copy link
Collaborator

I can repro this. Thanks for raising this, we'll look into it!

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

Successfully merging a pull request may close this issue.

3 participants