Coder Social home page Coder Social logo

kb-ai-research / kb-albert Goto Github PK

View Code? Open in Web Editor NEW
225.0 9.0 45.0 8.25 MB

KB국민은행에서 제공하는 경제/금융 도메인에 특화된 한국어 ALBERT 모델

License: Apache License 2.0

Python 100.00%
albert korean-nlp pytorch transformers nlp language-model financial-nlp

kb-albert's Issues

모델 공유 관련 질문

안녕하세요, KB-ALBERT 모델을 공유받고 싶어 메일을 보냈는데, 아직 공유 가능 여부를 답장으로 받지 못해 이슈 남깁니다.
혹시 지금은 공유가 아예 불가능하신 건가요? 아니면 아직 공유 여부를 결정 중이신 건가요?

Question Answering task 질문

안녕하세요, 혹시 현재 공유하고 계신 kb-albert 모델로 question answering task를 풀 수 있나요?
아니면 별도의 데이터셋으로 학습해야지 task를 풀 수 있는 건가요?

tokenizer = AlbertTokenizer.from_pretrained(kb_albert_model_path) 에서 에러가 납니다

tokenizer = AlbertTokenizer.from_pretrained(model_path) 부분을 실행하면 TypeError: not a string 에러가 뜹니다.
python 3.8
transformers 4.9.1 입니다.
에러 전문은 다음과 같습니다. 구글링 해도 해답 찾기가 쉽지가 않네요ㅜ
TypeError Traceback (most recent call last)
in
----> 1 tokenizer = AlbertTokenizer.from_pretrained('model')

~\anaconda3\envs\minsu\lib\site-packages\transformers\tokenization_utils_base.py in from_pretrained(cls, pretrained_model_name_or_path, *init_inputs, **kwargs)
1730 logger.info(f"loading file {file_path} from cache at {resolved_vocab_files[file_id]}")
1731
-> 1732 return cls._from_pretrained(
1733 resolved_vocab_files, pretrained_model_name_or_path, init_configuration, *init_inputs, **kwargs
1734 )

~\anaconda3\envs\minsu\lib\site-packages\transformers\tokenization_utils_base.py in _from_pretrained(cls, resolved_vocab_files, pretrained_model_name_or_path, init_configuration, *init_inputs, **kwargs)
1848 # Instantiate tokenizer.
1849 try:
-> 1850 tokenizer = cls(*init_inputs, **init_kwargs)
1851 except OSError:
1852 raise OSError(

~\anaconda3\envs\minsu\lib\site-packages\transformers\models\albert\tokenization_albert.py in init(self, vocab_file, do_lower_case, remove_space, keep_accents, bos_token, eos_token, unk_token, sep_token, pad_token, cls_token, mask_token, sp_model_kwargs, **kwargs)
169
170 self.sp_model = spm.SentencePieceProcessor(**self.sp_model_kwargs)
--> 171 self.sp_model.Load(vocab_file)
172
173 @Property

~\anaconda3\envs\minsu\lib\site-packages\sentencepiece_init_.py in Load(self, model_file, model_proto)
365 if model_proto:
366 return self.LoadFromSerializedProto(model_proto)
--> 367 return self.LoadFromFile(model_file)
368
369

~\anaconda3\envs\minsu\lib\site-packages\sentencepiece_init_.py in LoadFromFile(self, arg)
169
170 def LoadFromFile(self, arg):
--> 171 return _sentencepiece.SentencePieceProcessor_LoadFromFile(self, arg)
172
173 def DecodeIdsWithCheck(self, ids):

TypeError: not a string

Tensorflow 오류

안녕하세요, 며칠 전에 메일로 문의 드린 학생입니다. 먼저 답변 감사합니다.
문의 드리기 전에도 말씀하시대로 from_pt = True로 놓고 실행했었습니다. 코드는 README 4번 코드 그대로 사용했고
kb_albert_model_path = "model"만 추가했습니다. 실제로 pytorch 예제는 자 실행이 됩니다.
먼저 에러 내용은 다음과 같습니다.

All PyTorch model weights were used when initializing TFAlbertModel.

Some weights or buffers of the PyTorch model TFAlbertModel were not initialized from the TF 2.0 model and are newly initialized: ['predictions.LayerNorm.weight', 'sop_classifier.classifier.bias', 'predictions.decoder.bias', 'sop_classifier.classifier.weight', 'predictions.decoder.weight', 'predictions.dense.weight', 'predictions.dense.bias', 'predictions.LayerNorm.bias', 'predictions.bias']
You should probably TRAIN this model on a down-stream task to be able to use it for predictions and inference.
Traceback (most recent call last):
File "c:/Users/user/KB-ALBERT-KO/kb-albert-char/ex.py", line 12, in
tf_model = TFAlbertModel.from_pretrained(kb_albert_model_path)
File "C:\Users\user\AppData\Local\Programs\Python\Python37\lib\site-packages\transformers\modeling_tf_utils.py", line 437, in from_pretrained
[WEIGHTS_NAME, TF2_WEIGHTS_NAME], pretrained_model_name_or_path
OSError: Error no file named ['pytorch_model.bin', 'tf_model.h5'] found in directory model or from_pt set to False

model 파일 안에 pytorch_model.bin 파일이 있는데도 저런 오류가 뜨네요...

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.