Skip to content

Fix openai stream js snippet #1344

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 3 commits into from
Apr 9, 2025
Merged

Fix openai stream js snippet #1344

merged 3 commits into from
Apr 9, 2025

Conversation

Wauplin
Copy link
Contributor

@Wauplin Wauplin commented Apr 9, 2025

Originally from @cfahlgren1 in moon-landing (private link):

In inference snippets

  • [Bug] We don't add stream flag on javascript / openai snippet
  • [Bug] We pass provider param in openai api which causes error
  • [Improvement] Maybe we should have example not have \n after each chunk

EXample: https://huggingface.co/deepseek-ai/DeepSeek-V3-0324?inference_api=true&inference_provider=fireworks-ai&language=js

This PR addresses all 3 points. Fix is in https://github.com/huggingface/huggingface.js/pull/1344/files#diff-593c31a95f2e065cf06d977764fdc415600f67c5cc4a8204d73337ff6efd99c3.

Originally from @gary149 on slack (private link):

micro nit: "max_tokens": 512 everywhere instead of 500 (500 looks quite weird imo)

This PR addresses that as well.

Copy link
Contributor

@hanouticelina hanouticelina left a comment

Choose a reason for hiding this comment

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

thanks for fixing this!

@Wauplin Wauplin merged commit 4ee9b89 into main Apr 9, 2025
5 checks passed
@Wauplin Wauplin deleted the fix-openai-stream-js-snippet branch April 9, 2025 13:27
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.

2 participants