Comments (4)
답변 감사드립니다. :)
코드는 v1 으로 구현이 되어 있습니다.
모니터링 하고 있다가 업로드 해주실 때 사용하도록 하겠습니다.
최신 모델을 사용할 수 있게끔 공유해주시고, 공부에도 많은 도움을 주셔서 너무 감사드립니다.
from koelectra.
안녕하세요:)
@Luzzer 님이 사용하신 Tensorflow 버전이 v1인지 v2인지를 모르겠네요ㅠ
1. Tensorflow v2
transformers 라이브러리는 pytorch와 tensorflow 2를 모두 지원합니다.
from transformers import TFElectraModel, ElectraTokenizer
model = TFElectraModel.from_pretrained("monologg/koelectra-base-discriminator", from_pt=True)
tokenizer = ElectraTokenizer.from_pretrained("monologg/koelectra-base-discriminator")
text = "오늘 날씨는 맑아요"
encoded_input = tokenizer.encode_plus(
text=text,
add_special_tokens=True,
return_tensors="tf"
)
output = model(
inputs=encoded_input["input_ids"],
token_type_ids=encoded_input["token_type_ids"],
attention_mask=encoded_input["attention_mask"]
)
위에서 주의할 점은 model을 로딩할 때 from_pt=True
라는 인자를 주어야 한다는 것입니다.
해당 부분에 대한 것은 README에 추가하도록 하겠습니다.
2. Tensorflow v1
(아마 @Luzzer 님이 v1 기준으로 코드를 짜셨을 것으로 생각됩니다.)
v1 체크포인트는 빠른 시일 내에 구글 드라이브에 업로드해서 README에 업데이트 하도록 하겠습니다.
from koelectra.
안녕하세요!
TF v1 ckpt 모두 google drive에 업로드 했습니다. (관련 README Link)
공식 레포의 코드에 위의 ckpt를 이용하여 돌렸을 때 문제는 없었습니다. (hparams에서 vocab_size
만 32200으로 변경하여 finetuning 코드를 돌리면 될 것 같습니다)
혹시나 이슈가 생기면 알려주세요:)
from koelectra.
구글 드라이브 권한이 전체 공개가 아니었네요...방금 수정했습니다.
from koelectra.
Related Issues (20)
- base 버전의 tensorflow1 checkpoint 에러 HOT 4
- vocab, [unused] token에 대하여 HOT 3
- 단일 GPU 사전학습 이슈 HOT 3
- 추가학습 관련 질문드립니다. HOT 4
- Finetuning 에 대해서 질문드립니다. HOT 4
- Pretrain된 모델의 weight loading 이슈 HOT 5
- 멀티 클래스 repo HOT 5
- Fine-tuning 관련 질문 ( XLM-RoBERT-large 추가 ) HOT 5
- TFRecord 용량 문의 HOT 2
- hugging face 모델 로드 관련. HOT 7
- ElectraForSequenceClassification 사용시 트레이닝 질문
- vocab 생성 문의 HOT 2
- 전처리 관련 문의 HOT 4
- 사전학습 모델 파일 문의 HOT 2
- 모델 로딩 warning 질문 HOT 2
- position embedding 크기 수정 HOT 2
- [ max_length ] 512가 최대인데 텍스트가 최대를 넘을 경우
- vocab 생성관련 mecab pretokenize 방식
- maximum sequence length HOT 2
- WordPiece Vocabulary 예제 코드 에러 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from koelectra.