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

Add an example and type enhancement for TextStreamer #1066

Merged
merged 8 commits into from
Dec 3, 2024

Conversation

seonglae
Copy link
Contributor

@seonglae seonglae commented Dec 2, 2024

Added a GenerationConfig option for TextStreamer and included an example in the documentation as part of #394. I used the example you provided directly and tried to adhere to the repository's style as much as possible, but please let me know if anything deviates from the standard.

Copy link
Collaborator

@xenova xenova left a comment

Choose a reason for hiding this comment

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

Thanks! Just some suggestions.

docs/source/pipelines.md Outdated Show resolved Hide resolved
docs/source/pipelines.md Outdated Show resolved Hide resolved
docs/source/pipelines.md Show resolved Hide resolved
src/generation/streamers.js Show resolved Hide resolved
Copy link
Collaborator

@xenova xenova left a comment

Choose a reason for hiding this comment

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

LGTM ✅ Will run tests + build docs & merge soon.

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@xenova xenova merged commit 0dc1d8b into huggingface:main Dec 3, 2024
4 checks passed
@seonglae
Copy link
Contributor Author

seonglae commented Dec 3, 2024

If you don’t mind, I can contribute a chat-streaming example to the /example folder. Would it be okay to use Vite with Tailwind styling like others (or possibly Shadcn and Next.js), or is there a standard dependency stack for this repository examples?

@xenova
Copy link
Collaborator

xenova commented Dec 3, 2024

That would be much appreciated! However, could you instead contribute it to https://github.com/huggingface/transformers.js-examples? We're in the process of moving all examples to that repository.

In terms of stack, feel free to use what you like, but it should contribute to the example you are trying to showcase. For example, for a simple streaming example, I would recommend keeping it as simple as possible (just to highlight the important part; i.e., streaming). That said, it could be useful to see how to pass this information back from a web worker too, so feel free to contribute two examples if you'd like the second one to be more "fully-featured". In that case, feel free to use what you feel most comfortable with.

One other thing to note is that Next.js introduces another level of complexity since it can be run as a non-static site. Anyway, things to consider - I look forward to the contribution! Thanks!

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