You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using the swift framework, which relies on transformers==4.47.1. It's can use in NPU by huawei. However, this MolGen project is built on transformers==4.31.0 and uses custom Bart model code that is not compatible with the Chat Template feature introduced in transformers==4.47.1.
Specifically, I encounter the following error when using the swift framework:
ValueError: Cannot use chat template functions because tokenizer.chat_template is not set and no template argument was passed!
I want to adapt my MolGen project to work with transformers==4.47.1 to maintain compatibility with swift.
What I’ve Tried:
Downgrading transformers to 4.31.0 resolves the issue for MolGen, but it breaks the swift framework as it requires 4.47.1.
Investigating the use of chat_template but found MolGen's implementation heavily relies on the old API.
Questions:
What is the best way to adapt the MolGen project to support transformers==4.47.1 without breaking compatibility with its custom Bart model code?
Are there specific changes I can make to MolGen's codebase to ensure compatibility with swift while maintaining its functionality?
Any guidance or suggestions would be greatly appreciated. Thank you!
The text was updated successfully, but these errors were encountered:
Hi, thanks for your interest. Below are some possible adaptation ideas. They’re not guaranteed to work for every setup, so please test them yourself:
In the custom Bart/Tokenizer code, ensure tokenizer.chat_template is defined. For example, assign an empty ChatPromptTemplate during initialization, and ignore (or minimally handle) any chat-specific parameters in generate().
Look at the differences between the official Bart code in Transformers 4.31.0 and 4.47.1, then apply your custom modifications on top of the newer version. This likely involves editing files in the MolGen/model/bart folder.
I am using the swift framework, which relies on transformers==4.47.1. It's can use in NPU by huawei. However, this MolGen project is built on transformers==4.31.0 and uses custom Bart model code that is not compatible with the Chat Template feature introduced in transformers==4.47.1.
Specifically, I encounter the following error when using the swift framework:
I want to adapt my MolGen project to work with transformers==4.47.1 to maintain compatibility with swift.
What I’ve Tried:
Downgrading transformers to 4.31.0 resolves the issue for MolGen, but it breaks the swift framework as it requires 4.47.1.
Investigating the use of chat_template but found MolGen's implementation heavily relies on the old API.
Questions:
What is the best way to adapt the MolGen project to support transformers==4.47.1 without breaking compatibility with its custom Bart model code?
Are there specific changes I can make to MolGen's codebase to ensure compatibility with swift while maintaining its functionality?
Any guidance or suggestions would be greatly appreciated. Thank you!
The text was updated successfully, but these errors were encountered: