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

Improve speed by using dense evaluation for local models #28

Open
gordonwatts opened this issue Aug 17, 2024 · 0 comments
Open

Improve speed by using dense evaluation for local models #28

gordonwatts opened this issue Aug 17, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@gordonwatts
Copy link
Owner

From co-piolot:

The warning message indicates that you are using the transformers library's pipeline feature in a way that processes data sequentially on the GPU. This can be inefficient because it doesn't fully utilize the GPU's parallel processing capabilities. Instead, the library suggests using a dataset to batch process the data, which can significantly improve performance by leveraging the GPU more effectively.

Steps to Fix the Issue
Create a Dataset: Use a dataset to hold your input data.
Batch Processing: Use the dataset with the pipeline to process data in batches.
Pseudocode
Import necessary libraries.
Create a dataset from your input data.
Use the dataset with the pipeline for batch processing.
Example Code
Explanation
Import Libraries: Import the pipeline from transformers and Dataset from datasets.
Create Dataset: Convert your input data into a Dataset object.
Initialize Pipeline: Initialize the pipeline for your specific task (e.g., sentiment analysis).
Batch Processing: Use the pipeline to process the dataset in batches by specifying the batch_size parameter.
Output Results: Print or use the results as needed.
By following these steps, you can improve the efficiency of your pipeline by utilizing the GPU more effectively.
@gordonwatts gordonwatts added the enhancement New feature or request label Aug 17, 2024
@gordonwatts gordonwatts self-assigned this Aug 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant