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

new: Provide userwarning when specifying providers and cuda #425

Merged
merged 2 commits into from
Dec 24, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions fastembed/common/onnx_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,13 @@ def _load_onnx_model(
model_path = model_dir / model_file
# List of Execution Providers: https://onnxruntime.ai/docs/execution-providers

if cuda and providers is not None:
warnings.warn(
"You have specified both `cuda=True` and `providers`. This creates a conflict because `providers` takes precedence. "
"Avoid specifying `providers` and use `cuda=True` at the same time.",
category=UserWarning,
)
hh-space-invader marked this conversation as resolved.
Show resolved Hide resolved

if providers is not None:
onnx_providers = list(providers)
elif cuda:
Expand Down
Loading