Skip to content
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

Using turkish bert with tensorflow or tf.keras #7

Open
cansozbir opened this issue Feb 26, 2020 · 2 comments
Open

Using turkish bert with tensorflow or tf.keras #7

cansozbir opened this issue Feb 26, 2020 · 2 comments

Comments

@cansozbir
Copy link

I want to combine this model with a CNN in tensorflow or tensorflow.keras but couldn't handle how to use these checkpoint files. Can someone help me about how to use this model in tensorflow.keras?

file contains :
config.json
model.ckpt.data-00000-of-00001
model.ckpt.index
model.ckpt.meta
vocab.txt

@Balki7 Sure, here are the original TF checkpoints (best checkpoint, incl. config and vocab):

wget https://schweter.eu/cloud/bert-base-turkish-cased/bert-base-turkish-cased-tf.tar.gz

# sha256 bert-base-turkish-cased-tf.tar.gz
# 8113d0aeb32a2e7bcd00027195a13622387ca9e2132d7f9a1b27389a0db26b96

Thank u so much Stefan.

Originally posted by @Balki7 in #2 (comment)

@stefan-it
Copy link
Owner

Hi @cansozbir ,

you can now use the TF-compatible weights for all Turkish BERT models:

from transformers import  TFBertModel  

model = TFBertModel.from_pretrained('dbmdz/bert-base-turkish-cased')

I haven't worked with Transformers in combination with Keras yet, but I think this issue could be helpful to get it working:

huggingface/transformers#1350

@mdeniz1
Copy link

mdeniz1 commented Aug 18, 2023

Hi @stefan-it
I have used it with keras and it works fine but in a more recent issue from 2021 you again refer to downloading the weights instead of using the usual checkpoint. So which one should we use? Should we download it or use the checkpoint above?
Mehmet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants