jinmang2 / DOOLY

🦕 A library that handles everything with 🤗 and supports batching to models in PORORO
https://huggingface.co/jinmang2/dooly-hub
Apache License 2.0
36 stars 3 forks source link

transformers model weights load error #17

Closed jinmang2 closed 2 years ago

jinmang2 commented 2 years ago

https://github.com/huggingface/transformers/commit/5da33f872913255d64717efe745a053975bbc28e

4월 12일에 해당 스크립트보고 4.18.0 대비 커밋을 푸쉬했는데 (https://github.com/jinmang2/DOOLY/commit/89ce3f90e19215cf3cfd100a0252acb14f2fc8e9)

4월 15일에 메서드에 arguments가 하나 더 추가되었다... ㅎㅎ (loaded_state_dict_keys)

v1.x.x에서는 modeling_utils를 건드리지 않고 model weights를 호출해야할 방법을 찾아야겠다.

우선 이를 v0.1.3에서 fix한다.

jinmang2 commented 2 years ago

다행히 v4.19.0 version으로 디버깅이 가능할 듯 하다.

version.parse(transformers.__version__) >= version.parse("4.19.0")

하지만... transformers의 backend 모듈에 디펜던시가 생기면 5버전 5.x버전 업데이트하면서 해당 모듈에 계속 버그가 생길 것 같다. PR 때리던지 해야지 원 참... 왜 model에는 subfolder 지원을 안해주는걸까!

jinmang2 commented 2 years ago
!pip install dooly
# !pip install git+https://github.com/jinmang2/DOOLY

import dooly
print(dooly.__version__)
# v0.1.3

from dooly import Dooly

mt = Dooly("mt", "multi")

mt("L, 알고 있는가? 사신은 사과만 먹는다네.", "ko", "en")
# L, do you know? You only eat apples.

bug fix 및 v0.1.3 배포. issue closing

jinmang2 commented 2 years ago