/
githubmirror
/
transformers
Обзор
Документация
Войти
/
githubmirror
/
transformers
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
examples/modular-transformers/modular_switch_function.py
10 строк
488 B
Cyril Vallez
Modular: support for importing functions from any file (#35692)
16 янв 2025, 19:37
Не верифицирован
16 янв 2025, 19:37
91be6a5
Код
Авторство
О чём код?
# Note that llama and cohere have different definitions for rotate_half from transformers.models.cohere.modeling_cohere import rotate_half # noqa from transformers.models.llama.modeling_llama import LlamaAttention # When following LlamaAttention dependencies, we will grab the function `rotate_half` defined # in `modeling_llama.py`. But here we imported it explicitly from Cohere, so it should use Cohere's # definition instead class SwitchFunctionAttention(LlamaAttention): pass