Use logging.warning instead of warnings.warn in pipeline.__call__ (#29717)

* Use logging.warning instead of warnings.warn in pipeline.__call__

* Update src/transformers/pipelines/base.py
This commit is contained in:
Motoki Wu 2024-03-19 02:23:22 -07:00 committed by GitHub
parent 838b87abe2
commit 484e10f7f2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1164,7 +1164,7 @@ class Pipeline(_ScikitCompat):
self.call_count += 1
if self.call_count > 10 and self.framework == "pt" and self.device.type == "cuda":
warnings.warn(
logger.warning_once(
"You seem to be using the pipelines sequentially on GPU. In order to maximize efficiency please use a"
" dataset",
UserWarning,