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

Chatbot LaTeX Crash Fix #8658

Merged
merged 19 commits into from
Jul 11, 2024
Merged

Chatbot LaTeX Crash Fix #8658

merged 19 commits into from
Jul 11, 2024

Conversation

dawoodkhan82
Copy link
Collaborator

@dawoodkhan82 dawoodkhan82 commented Jun 28, 2024

Description

With this fix, it seems to be crashing a lot less. Also doesn't seem like the Latex is being rendered correctly anymore.

Closes: #8006

🎯 PRs Should Target Issues

Before your create a PR, please check to see if there is an existing issue for this change. If not, please create an issue before you create this PR, unless the fix is very small.

Not adhering to this guideline will result in the PR being closed.

Tests

  1. PRs will only be merged if tests pass on CI. To run the tests locally, please set up your Gradio environment locally and run the tests: bash scripts/run_all_tests.sh

  2. You may need to run the linters: bash scripts/format_backend.sh and bash scripts/format_frontend.sh

@gradio-pr-bot
Copy link
Collaborator

gradio-pr-bot commented Jun 28, 2024

🪼 branch checks and previews

Name Status URL
Spaces ready! Spaces preview
Website building...
Storybook ready! Storybook preview
🦄 Changes detecting...

Install Gradio from this PR

pip install https://gradio-builds.s3.amazonaws.com/2178a090bc5187971cb15180210bea20e67c0d07/gradio-4.37.2-py3-none-any.whl

Install Gradio Python Client from this PR

pip install "gradio-client @ git+https://github.com/gradio-app/gradio@2178a090bc5187971cb15180210bea20e67c0d07#subdirectory=client/python"

Install Gradio JS Client from this PR

npm install https://gradio-builds.s3.amazonaws.com/2178a090bc5187971cb15180210bea20e67c0d07/gradio-client-1.2.1.tgz

@gradio-pr-bot
Copy link
Collaborator

gradio-pr-bot commented Jun 28, 2024

🦄 change detected

This Pull Request includes changes to the following packages.

Package Version
@gradio/markdown patch
gradio patch
  • Maintainers can select this checkbox to manually select packages to update.

With the following changelog entry.

Chatbot LaTeX Crash Fix

Maintainers or the PR author can modify the PR title to modify this entry.

Something isn't right?

  • Maintainers can change the version label to modify the version bump.
  • If the bot has failed to detect any changes, or if this pull request needs to update multiple packages to different versions or requires a more comprehensive changelog entry, maintainers can update the changelog file directly.

@dawoodkhan82
Copy link
Collaborator Author

Can't seem to figure out this bug. This fix helps, but doesn't fully resolve the error: Failed to execute 'insertBefore' on 'Node': The node before which the new node is to be inserted is not a child of this node. Definitely something with the order of how things are rendered in the DOM.

@pngwn if you get a chance, could use a second set of eyes.

Copy link
Member

@pngwn pngwn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah interesting! Just one small comment but otherwise looks great. Thanks @dawoodkhan82!

Comment on lines 76 to 78
onMount(() => {
el = document.getElementById("container") as HTMLSpanElement;
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is essentially the same as the binding, does just having the condition in the afterUpdate address this issue?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, it still crashes half the time. Seems like KaTex doesn't play well with svelte since both manipulate the DOM.

pngwn and others added 14 commits July 10, 2024 01:34
* styling for codeblocks

* add changeset

* formatting

* add changeset

* changes

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
* display modes

* add changeset

* test fixes

* lint

* Update gradio/components/model3d.py

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>

* solid

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
* Fix the Playground on the website to trigger run_code() and install() with debounce and to display errors

* Remove an unused function, make_full_screen()

* Format demo/hello_world/run.py

* Update notebook

* add changeset

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
#8705)

* GRADIO_ALLOWED_PATHS & GRADIO_BLOCKED_PATHS comma separated environment variables

* GRADIO_ALLOWED_PATHS & GRADIO_BLOCKED_PATHS comma separated environment variables

* add changeset

* Document GRADIO_ALLOWED_PATHS and GRADIO_BLOCKED_PATHS

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
…atus messages (#8699)

* * bind handle_space_success
* ensure status callbacks work correctly

* add changeset

* test fixes + refactor

* tweak

* test

* Revert "test"

This reverts commit db1afc4.

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
…e Blocks.config object (#8720)

* auth docs

* changes

* add changeset

* add changeset

* add changeset

* type

* changes

* snippets

* import

* add changeset

* changes

* fix typing

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
@dawoodkhan82 dawoodkhan82 marked this pull request as ready for review July 11, 2024 00:11
@dawoodkhan82 dawoodkhan82 merged commit 0482453 into main Jul 11, 2024
8 checks passed
@dawoodkhan82 dawoodkhan82 deleted the latex-fix branch July 11, 2024 16:28
@pngwn pngwn mentioned this pull request Jul 11, 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.

Chatbot component freeze when using specific LaTeX delimiters
8 participants