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 ability to chunk CSV in either row or file #552

Merged

Conversation

WToa
Copy link
Contributor

@WToa WToa commented Apr 2, 2024

Looking to address the issue in #549


def chunk_mode
if @options[:chunk_mode].to_s.empty?
CHUNK_MODE[:row]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure about this, I'm defaulting to row

.compact
.map(&:strip)
.join(separator)
end.join("\n\n")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

From what I can tell, by default if a string is separated by \n\n then it gets chunked when it's acted on by Langchain::Chunker::Text Let me know if that's incorrect or you prefer a different approach

@WToa WToa force-pushed the add-chunk-csv-by-row-or-file branch from 4efbbf5 to ee25bf1 Compare April 14, 2024 00:55
@andreibondarev
Copy link
Collaborator

@WToa Thank you for the PR!

@andreibondarev andreibondarev merged commit 2efab17 into patterns-ai-core:main Apr 17, 2024
5 checks passed
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.

None yet

2 participants