-
Notifications
You must be signed in to change notification settings - Fork 3.2k
[WIP] Support export of Llama with DynamicCache and transformers>=4.51 #24379
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
Conversation
@@ -7,6 +7,7 @@ | |||
|
|||
import numpy as np | |||
import torch | |||
import transformers |
Check notice
Code scanning / CodeQL
Module is imported with 'import' and 'import from' Note
Module 'onnxruntime.test.python.transformers' is imported with both 'import' and 'import from'.
import torch | ||
import transformers |
Check notice
Code scanning / CodeQL
Module is imported with 'import' and 'import from' Note
Module 'onnxruntime.test.python.transformers' is imported with both 'import' and 'import from'.
onnxruntime/python/tools/transformers/models/torch_export_patches/__init__.py
Fixed
Show fixed
Hide fixed
return {torch_deepcopy(v) for v in value} | ||
if isinstance(value, dict): | ||
return {k: torch_deepcopy(v) for k, v in value.items()} | ||
if isinstance(value, np.ndarray): |
Check failure
Code scanning / lintrunner
RUFF/F821 Error
See https://docs.astral.sh/ruff/rules/undefined-name
Description
Description
Replaces #24291.
transformers>=4.51 makes DynamicCache exportable.
The modification were tested with a tiny LLM: