Giter Club home page Giter Club logo

Comments (4)

Luzzer avatar Luzzer commented on May 20, 2024 1

답변 감사드립니다. :)
코드는 v1 으로 구현이 되어 있습니다.
모니터링 하고 있다가 업로드 해주실 때 사용하도록 하겠습니다.
최신 모델을 사용할 수 있게끔 공유해주시고, 공부에도 많은 도움을 주셔서 너무 감사드립니다. 👍

from koelectra.

monologg avatar monologg commented on May 20, 2024

안녕하세요:)

@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.

monologg avatar monologg commented on May 20, 2024

@Luzzer

안녕하세요!

TF v1 ckpt 모두 google drive에 업로드 했습니다. (관련 README Link)

공식 레포의 코드에 위의 ckpt를 이용하여 돌렸을 때 문제는 없었습니다. (hparams에서 vocab_size만 32200으로 변경하여 finetuning 코드를 돌리면 될 것 같습니다)

혹시나 이슈가 생기면 알려주세요:)

from koelectra.

monologg avatar monologg commented on May 20, 2024

@Luzzer

구글 드라이브 권한이 전체 공개가 아니었네요...방금 수정했습니다.

from koelectra.

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.