-
Notifications
You must be signed in to change notification settings - Fork 47
feat: implement batch sentiment analysis and add batch endpoint #26
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
base: main
Are you sure you want to change the base?
Changes from 1 commit
a4eacee
6ae0c87
737cbe1
a09941c
ca3179e
5d0b214
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,4 +10,5 @@ logs/ | |
| # Ignore Testing Coverage Results | ||
| tests/coverage/.coverage | ||
|
|
||
| env/ | ||
| env/ | ||
| models_cache/ | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why did u modify in this file?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. According to my understanding of the issue, I modified bertweet_model.py to implement Tensor-based batching directly within the model's forward pass. Handling batches at the model level (using padding=True and truncation=True) leverages PyTorch's parallelism, making inference significantly faster than looping over strings. I've also ensured the method remains backward-compatible, so it still works perfectly for single strings (as it used to) while supporting lists of strings. Regarding the logs, I've removed the initial debug logs to keep the PR focused and clean.
|

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops I’ve already cleaned up the .gitignore and reverted those unnecessary changes