-
Notifications
You must be signed in to change notification settings - Fork 29
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
How to use w transformers? #30
Comments
You can use patch_hf for transformers. from inf_llm.utils import patch_hf
config = load_yaml_config()['model']
model = patch_hf(model, config['type'], **config) |
"load_yaml_config"? I tried
and I get an error about only certain model's are supported, mistral, llama, etc.
|
while I can patch the model it won't work with the standard HF tools. Transformers assumes past_key_values to be subscriptable but past_key_values is a ContextManager
|
import yaml def load_yaml_config(file_path='path_to_your_config_file.yaml'): Load the configuration for infinite contextconfig_path = 'minicpm-inf-llm.yaml' from inf_llm.utils import patch_hf producesValueError Traceback (most recent call last) File /home/user/mamba/InfLLM/inf_llm/utils/patch.py:150, in patch_hf(model, attn_type, attn_kwargs, base, distance_scale, **kwargs) ValueError: Only supports llama, mistral and qwen2 models. |
I use transformers with a custom script, I see you show how to use this with a custom fast chat script
Do you have boilerplate code on how to wrap a transformers pipeline to use w this?
The text was updated successfully, but these errors were encountered: