Git Product home page Git Product logo

Comments (4)

kpe avatar kpe commented on August 14, 2024

@hankcs - are you referring to the BERT weights (i.e. https://storage.googleapis.com/bert_models/2018_11_03/chinese_L-12_H-768_A-12.zip or https://storage.googleapis.com/bert_models/2018_11_23/multi_cased_L-12_H-768_A-12.zip)?

If you have problems loading the weights, could you please post the exact source code you are using here, or check with the README.md, i.e.:

model_name = "chinese_L-12_H-768_A-12"
model_dir = bert.fetch_google_bert_model(model_name, ".models")
model_ckpt = os.path.join(model_dir, "bert_model.ckpt")

bert_params = bert.params_from_pretrained_ckpt(model_dir)
l_bert = bert.BertModelLayer.from_params(bert_params, name="bert")

# use in Keras Model here, and call model.build()

bert.load_bert_weights(l_bert, model_ckpt)

from bert-for-tf2.

kpe avatar kpe commented on August 14, 2024

reopening - I guess it is about the https://github.com/google-research/ALBERT weights, i.e. https://storage.googleapis.com/albert_models/albert_base_zh.tar.gz

from bert-for-tf2.

kpe avatar kpe commented on August 14, 2024

@hankcs - loading of the official Google ALBERT weights should now be possible -

model_name = "albert_base_v2"
model_dir    = bert.fetch_google_albert_model(model_name, ".models")
model_ckpt   = os.path.join(albert_dir, "model.ckpt-best")

model_params = bert.albert_params(model_dir)
l_bert = bert.BertModelLayer.from_params(model_params, name="albert")

# use in Keras Model here, and call model.build()

bert.load_albert_weights(l_bert, model_ckpt)      # should be called after model.build()

from bert-for-tf2.

hankcs avatar hankcs commented on August 14, 2024

Yes, thank you.

from bert-for-tf2.

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.