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

Expand token length for existing code and prompt in playground #10355

Merged
merged 2 commits into from
Jan 15, 2025

Conversation

aliabd
Copy link
Collaborator

@aliabd aliabd commented Jan 14, 2025

Over time as we've been changing the prompt and and what we append to queries, we've chipped away at how long existing code can be. Leading to errors when you prompt with code that isn't really that long.

I reduced the system prompt here so existing code can be ~1000 tokens.

Also added an error to the UI when the existing code is too long so it's at least obvious to the user what the problem is. (made some changes on the worker as well)

Screen.Recording.2025-01-14.at.11.28.17.AM.mov

@abidlabs please test your query here.

@aliabd aliabd requested a review from abidlabs January 14, 2025 19:58
@gradio-pr-bot
Copy link
Collaborator

gradio-pr-bot commented Jan 14, 2025

🪼 branch checks and previews

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

Install Gradio from this PR

pip install https://gradio-pypi-previews.s3.amazonaws.com/6400c4cab8211414bf163bc88b75e3413531c8ef/gradio-5.12.0-py3-none-any.whl

Install Gradio Python Client from this PR

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

Install Gradio JS Client from this PR

npm install https://gradio-npm-previews.s3.amazonaws.com/6400c4cab8211414bf163bc88b75e3413531c8ef/gradio-client-1.10.0.tgz

Use Lite from this PR

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

@gradio-pr-bot
Copy link
Collaborator

🦄 change detected

This Pull Request includes changes to the following packages.

Package Version
website minor
  • Maintainers can select this checkbox to manually select packages to update.

With the following changelog entry.

Expand token length for existing code and prompt in playground

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.

@abidlabs
Copy link
Member

Nice @aliabd. My original code is working now. But I was testing the too long error and I noticed that when the too long error occurs, the cicular pending icon appears and the cancel button still pops up. Is that expected? I would have thought that if the character length is too high, it would immediately abort or something. Minor detail, otherwise lgtm

Screen.Recording.2025-01-14.at.3.00.53.PM.mov

@aliabd
Copy link
Collaborator Author

aliabd commented Jan 15, 2025

@abidlabs yeah so the pending status and cancel button will always appear because we get this and all the other errors from the playground worker.

But you're right they shouldn't be staying this long, It's kind of complicated though, so will fix in my refactoring pr

@aliabd aliabd merged commit 070cab5 into main Jan 15, 2025
23 of 24 checks passed
@aliabd aliabd deleted the playground-prompt branch January 15, 2025 02:33
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.

3 participants