Views
No views yet
gelu_new activations, and a byte-pair-encoding tokenizer, trained on BookCorpus.
This is the 117M base completion model (no chat template).openai-community/openai-gpt for
zeromodels. One implementation runs unmodified on
TensorFlow / Torch / JAX.1import os
2os.environ["KERAS_BACKEND"] = "torch" # or "jax" / "tensorflow"
3
4from zeromodels.models.gpt import GptTextGenerate, GptTokenizer
5
6model = GptTextGenerate.from_weights("zeromodels/gpt")
7tokenizer = GptTokenizer.from_weights("zeromodels/gpt")
8
9inputs = tokenizer("the meaning of life is")
10outputs = model.generate(**inputs, max_new_tokens=40)
11print(tokenizer.decode(outputs[0]))KERAS_BACKEND before importing Keras / zeromodels.hf: prefix, e.g.
GptTextGenerate.from_weights("hf:openai-community/openai-gpt").