-
Notifications
You must be signed in to change notification settings - Fork 137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tensorflow에서 사용가능한 모델도 배포하실 예정이 있으신가요? #6
Comments
안녕하세요:) @Luzzer 님이 사용하신 Tensorflow 버전이 v1인지 v2인지를 모르겠네요ㅠ 1. Tensorflow v2transformers 라이브러리는 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을 로딩할 때 2. Tensorflow v1(아마 @Luzzer 님이 v1 기준으로 코드를 짜셨을 것으로 생각됩니다.) v1 체크포인트는 빠른 시일 내에 구글 드라이브에 업로드해서 README에 업데이트 하도록 하겠습니다. |
답변 감사드립니다. :) |
안녕하세요! TF v1 ckpt 모두 google drive에 업로드 했습니다. (관련 README Link) 공식 레포의 코드에 위의 ckpt를 이용하여 돌렸을 때 문제는 없었습니다. (hparams에서 혹시나 이슈가 생기면 알려주세요:) |
구글 드라이브 권한이 전체 공개가 아니었네요...방금 수정했습니다. |
안녕하세요. @monologg 님, 자연어처리를 공부중인 학생입니다.
항상 좋은 글들과 모델들을 공유해주셔서 감사드립니다.
이번에 공유해주신 KoELECTRA 모델을 사용해서 fine-tuning을 진행해보고 싶은데요.
기존 사용하던 코드가 Tensorflow로 구현되어있어 Tensorflow 버전용 모델도 공유하실 예정이 있으신지 궁금합니다.
아니면 pytorch 모델을 tensorflow 모델로 바꾸어 사용할 수 있는 방법이 따로 있는지 궁금합니다.
The text was updated successfully, but these errors were encountered: