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

feat: add batch run beta component #5489

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

feat: add batch run beta component #5489

wants to merge 2 commits into from

Conversation

rodrigosnader
Copy link
Contributor

This component allows multiple texts coming from a LF DataFrame object to be processed by a language model and returns a DataFrame with the generated content per row.

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. enhancement New feature or request labels Dec 30, 2024
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Dec 30, 2024
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Dec 30, 2024
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Dec 30, 2024
@rodrigosnader
Copy link
Contributor Author

Attached is a flow to test the component.

Screenshot 2024-12-30 at 6 17 26 PM

Batch Run - Demo.json

conversation.append({"role": "user", "content": text})

# Invoke the model
response = model.invoke(conversation)
Copy link
Contributor

Choose a reason for hiding this comment

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

No need to do this. Langchain has a batch method. Also, it is better to using async methods as it can help with performance.

https://python.langchain.com/docs/how_to/lcel_cheatsheet/#batch-a-runnable

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So what's the proposal? Change this component or create a "batch mode" for models?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request size:M This PR changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants