remove jax.ops.index (#16220)

This commit is contained in:
Suraj Patil
2022-03-17 17:51:43 +01:00
committed by GitHub
parent 8481ecefbd
commit 93d3fd8645
5 changed files with 9 additions and 10 deletions

View File

@@ -35,7 +35,7 @@ model = FlaxGPTNeoForCausalLM.from_pretrained("EleutherAI/gpt-neo-1.3B")
emb = jnp.zeros((50264, model.config.hidden_size))
# update the first 50257 weights using pre-trained weights
emb = emb.at[jax.ops.index[:50257, :]].set(model.params["transformer"]["wte"]["embedding"])
emb = emb.at[:50257, :].set(model.params["transformer"]["wte"]["embedding"])
params = model.params
params["transformer"]["wte"]["embedding"] = emb