Skip to content

huggingface: add astream for huggingface pipeline #31575

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

nazeudon
Copy link

@nazeudon nazeudon commented Jun 12, 2025

Description

Adds async streaming support to HuggingFacePipeline via a new _astream method. ChatHuggingFace now also supports async streaming by following this update. Both implementations closely follow the structure of the existing stream methods.

Issue

none (as long as I am aware)

Dependencies

none

tests and docs

  • Added a test for HuggingFacePipeline's new _astream method

Lint and test

  • make format
  • make lint
  • make test

Additional guidelines:

  • Make sure optional dependencies are imported within a function.
  • Please do not add dependencies to pyproject.toml files (even optional ones) unless they are required for unit tests.
  • Most PRs should not touch more than one package.
  • Changes should be backwards compatible.

If no one reviews your PR within a few days, please @-mention one of baskaryan, eyurtsev, ccurme, vbarda, hwchase17.

Copy link

vercel bot commented Jun 12, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
langchain ⬜️ Ignored (Inspect) Visit Preview Jun 12, 2025 7:47am

@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Jun 12, 2025
@nazeudon nazeudon changed the title add: astream for huggingface pipeline huggingface: astream for huggingface pipeline Jun 12, 2025
@nazeudon nazeudon changed the title huggingface: astream for huggingface pipeline huggingface: add astream for huggingface pipeline Jun 12, 2025
Copy link

codspeed-hq bot commented Jun 12, 2025

CodSpeed Walltime Performance Report

Merging #31575 will not alter performance

Comparing nazeudon:hf_pipeline_astream (1c589da) with master (446a9d5)

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

Summary

✅ 13 untouched benchmarks

Copy link

codspeed-hq bot commented Jun 12, 2025

CodSpeed Instrumentation Performance Report

Merging #31575 will not alter performance

Comparing nazeudon:hf_pipeline_astream (1c589da) with master (446a9d5)

Summary

✅ 13 untouched benchmarks

@eyurtsev eyurtsev self-assigned this Jun 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants