初始化项目,由ModelHub XC社区提供模型
Model: flax-community/gpt2-medium-indonesian Source: Original Platform
This commit is contained in:
12
jax2torch.py
Normal file
12
jax2torch.py
Normal file
@@ -0,0 +1,12 @@
|
||||
from transformers import AutoTokenizer, GPT2LMHeadModel
|
||||
|
||||
'''
|
||||
This is a script to convert the Jax model and the tokenizer to Pytorch model
|
||||
'''
|
||||
|
||||
model = GPT2LMHeadModel.from_pretrained(".", from_flax=True)
|
||||
model.save_pretrained(".")
|
||||
|
||||
tokenizer = AutoTokenizer.from_pretrained(".")
|
||||
tokenizer.save_pretrained(".")
|
||||
|
||||
Reference in New Issue
Block a user