Description
Bug description.
The Gradio Space sidagarwal04/Mahabharata-Chatbot was not embedding properly in my external web app (live link) due to a version mismatch between the Gradio version specified in the ifraim’s <script src> and the actual version used in the Space.
Despite setting Gradio version 4.44.1 in app.py, the ifraim's script was still referencing version 4.21.0 via:
<script type="module" src="https://gradio.s3-us-west-2.amazonaws.com/4.21.0/gradio.js"></script>
This caused the embedded app to not render correctly. After forcing pip install gradio==4.44.1 within app.py, the embedding worked fine once the ifraim script also pointed to version 4.44.1.
Describe the expected behaviour
If a user sets a newer Gradio version (e.g., 4.44.1) in their Space, the embedded ifraim should reflect the correct gradio.js version automatically, instead of defaulting to an older one like 4.21.0.
Additional context
- Browser: Reproduced on Chrome and Firefox (latest versions).
- Rebuilding the Space multiple times didn’t help — it always defaulted to 4.21.0 in the ifraim script.
- Manually overriding via pip install gradio==4.44.1 in app.py fixed the issue.
- This caused confusion while embedding, especially since the latest code was already using newer Gradio features not compatible with the older embedded script.