Giter VIP home page Giter VIP logo

Comments (5)

om304 avatar om304 commented on May 18, 2024 1

That was it, I wasn't loading the individual task adapters with model.load_adapter() before using model.load_adapter_fusion() - many thanks for your help, it's all working now!

from adapters.

calpt avatar calpt commented on May 18, 2024

Hi @om304,

Thanks for reporting. Your issue might already be fixed with a recent update to the library. Please try to update to the most recent version of the master branch:

pip install -U git+https://github.com/adapter-hub/adapter-transformers.git

from adapters.

om304 avatar om304 commented on May 18, 2024

Many thanks for the quick reply, I updated the library as recommended and repeated the above steps and now got this error message after running model.load_adapter_fusion():

  File "<stdin>", line 1, in <module>
  File "/home/om304/anaconda3/lib/python3.7/site-packages/transformers/adapter_model_mixin.py", line 867, in load_adapter_fusion
    load_dir, load_name = loader.load(adapter_fusion_name_or_path, load_as)
  File "/home/om304/anaconda3/lib/python3.7/site-packages/transformers/adapter_model_mixin.py", line 486, in load
    self.model.add_fusion(adapter_fusion_name, config["config"])
  File "/home/om304/anaconda3/lib/python3.7/site-packages/transformers/adapter_model_mixin.py", line 746, in add_fusion
    self.base_model.add_fusion_layer(adapter_names)
  File "/home/om304/anaconda3/lib/python3.7/site-packages/transformers/adapter_bert.py", line 582, in add_fusion_layer
    self.encoder.add_fusion_layer(adapter_names)
  File "/home/om304/anaconda3/lib/python3.7/site-packages/transformers/adapter_bert.py", line 473, in add_fusion_layer
    layer.add_fusion_layer(adapter_names)
  File "/home/om304/anaconda3/lib/python3.7/site-packages/transformers/adapter_bert.py", line 455, in add_fusion_layer
    self.attention.output.add_fusion_layer(adapter_names)
  File "/home/om304/anaconda3/lib/python3.7/site-packages/transformers/adapter_bert.py", line 69, in add_fusion_layer
    if self.config.adapters.common_config_value(adapter_names, "mh_adapter"):
  File "/home/om304/anaconda3/lib/python3.7/site-packages/transformers/adapter_config.py", line 249, in common_config_value
    config_value = self.get(name).get(attribute, None)
AttributeError: 'NoneType' object has no attribute 'get' 

from adapters.

calpt avatar calpt commented on May 18, 2024

This error looks like no adapter was found for one of the fusion tasks you provide, i.e. the model does not include an adapter for either "qqp" or "snli". Did you make sure to load both trained adapter modules using model.load_adapter() before loading the fusion layer using model.load_adapter_fusion()?

from adapters.

Yujin-Yujin avatar Yujin-Yujin commented on May 18, 2024

Cannot load either

from adapters.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.