Skip to content

Update Transformers agent demo #9885

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

Merged
merged 16 commits into from
Dec 23, 2024
Merged

Conversation

freddyaboulton
Copy link
Collaborator

@freddyaboulton freddyaboulton commented Nov 1, 2024

Description

The stream to gradio logic has been merged to transformers.
Also the tool syntax has been modified a bit.

tf_agent_output

🎯 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

@freddyaboulton freddyaboulton added the docs/website Related to documentation or website label Nov 1, 2024
@gradio-pr-bot
Copy link
Collaborator

gradio-pr-bot commented Nov 1, 2024

🪼 branch checks and previews

Name Status URL
Spaces ready! Spaces preview
Website ready! Website preview
🦄 Changes detected! Details

Install Gradio from this PR

pip install https://gradio-pypi-previews.s3.amazonaws.com/3ec6726805df1a25d9f6ab20d0a33b7d497a6f82/gradio-5.9.1-py3-none-any.whl

Install Gradio Python Client from this PR

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

Install Gradio JS Client from this PR

npm install https://gradio-npm-previews.s3.amazonaws.com/3ec6726805df1a25d9f6ab20d0a33b7d497a6f82/gradio-client-1.8.0.tgz

Use Lite from this PR

<script type="module" src="https://gradio-lite-previews.s3.amazonaws.com/3ec6726805df1a25d9f6ab20d0a33b7d497a6f82/dist/lite.js""></script>

@gradio-pr-bot
Copy link
Collaborator

gradio-pr-bot commented Nov 1, 2024

🦄 no changes detected

This Pull Request does not include changes to any packages.

__No changes detected. __

  • Maintainers can select this checkbox to manually select packages to update.

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 create the changelog file directly.

@freddyaboulton freddyaboulton marked this pull request as ready for review December 18, 2024 17:34

llm_engine = HfEngine("meta-llama/Meta-Llama-3-70B-Instruct")
# Initialize the agent with both tools
llm_engine = HfApiEngine("meta-llama/Meta-Llama-3-70B-Instruct")
Copy link
Member

@abidlabs abidlabs Dec 19, 2024

Choose a reason for hiding this comment

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

just fyi there are some discrepancies between the code here and the complete demo, e.g. the llm engine in the demo is Qwen/Qwen2.5-Coder-32B-Instruct

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes good point!

Copy link
Member

@abidlabs abidlabs left a comment

Choose a reason for hiding this comment

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

Very cool @freddyaboulton works great! Two small suggestions:

  • I'd suggest adding some examples to the Chatbot make it clearer what this agent is capable of
  • What about using gr.ChatInterface now that returning multiple messages is supported? That'd streamline the code and give you a nicer UI out of the box

aliabid94 and others added 8 commits December 23, 2024 12:13
…as a ChatInterface (#10222)

* changes

* add changeset

* add changeset

* Update gradio/external.py

Co-authored-by: Abubakar Abid <[email protected]>

* changes

* changes

* Update guides/05_chatbots/01_creating-a-chatbot-fast.md

Co-authored-by: Abubakar Abid <[email protected]>

* changes

---------

Co-authored-by: Ali Abid <[email protected]>
Co-authored-by: gradio-pr-bot <[email protected]>
Co-authored-by: Abubakar Abid <[email protected]>
* changes

* add changeset

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* Update gradio/events.py

Co-authored-by: Abubakar Abid <[email protected]>

* Update gradio/components/chatbot.py

Co-authored-by: Abubakar Abid <[email protected]>

* changes

---------

Co-authored-by: Ali Abid <[email protected]>
Co-authored-by: gradio-pr-bot <[email protected]>
Co-authored-by: Abubakar Abid <[email protected]>
… and website widgets (#10221)

* changes

* changes

* update

* chat history

* add changeset

* changes

* add changeset

* changes

* guide

* changes

* changes

* changes

* guide

* add images

* slack guide

* changes

* format

* add changeset

* finish up slack

* changes

* improve js guide

* update

* changes

* script

* changes

* changes

* add changeset

* Update guides/05_chatbots/01_creating-a-chatbot-fast.md

Co-authored-by: Ali Abdalla <[email protected]>

* Update guides/05_chatbots/01_creating-a-chatbot-fast.md

Co-authored-by: Ali Abdalla <[email protected]>

* Update guides/05_chatbots/06_creating-a-discord-bot-from-a-gradio-app.md

Co-authored-by: Ali Abdalla <[email protected]>

* Update guides/05_chatbots/08_creating-a-website-widget-from-a-gradio-chatbot.md

Co-authored-by: Ali Abdalla <[email protected]>

* Update guides/05_chatbots/08_creating-a-website-widget-from-a-gradio-chatbot.md

Co-authored-by: Ali Abdalla <[email protected]>

* gradio

* cta

---------

Co-authored-by: gradio-pr-bot <[email protected]>
Co-authored-by: Ali Abdalla <[email protected]>
* changes

* add changeset

* changes

* changes

* changes

---------

Co-authored-by: Ali Abid <[email protected]>
Co-authored-by: gradio-pr-bot <[email protected]>
…y` (#10235)

* changes

* add changeset

* changes

* changes

* change

* add changeset

* image.py

* revert msg

---------

Co-authored-by: gradio-pr-bot <[email protected]>
* Add stdout and stderr events

* add changeset

* Refactoring

* Format App.tsx

* add changeset

* Add python-error event to capture Python errors occurring in the running event loop after the initial app launch

* Fix <ErrorDisplay />'s close button

* Fix <ErrorDisplay />

* Propagate python-error and initialization-error events to the controller

* Add init-code|file-run-error events

---------

Co-authored-by: gradio-pr-bot <[email protected]>
@freddyaboulton freddyaboulton enabled auto-merge (squash) December 23, 2024 17:15
@freddyaboulton freddyaboulton merged commit 9bdec8c into main Dec 23, 2024
23 checks passed
@freddyaboulton freddyaboulton deleted the modify-transformers-agent-demo branch December 23, 2024 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs/website Related to documentation or website
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants