Instructions to use JTSJohnny/pipi0 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Keras
How to use JTSJohnny/pipi0 with Keras:
# !pip install -U keras tensorflow huggingface_hub # Keras needs TensorFlow installed to read "hf://" paths, so the tensorflow backend is selected here; # "jax" and "torch" also work for computation once TensorFlow is installed. import os os.environ["KERAS_BACKEND"] = "tensorflow" import keras model = keras.saving.load_model("hf://JTSJohnny/pipi0") - Notebooks
- Google Colab
- Kaggle
Download utils/train_tokenizer.py from JTSJohnny/pipi0: direct link, hf CLI and curl.
- Browser
- Download file 564 Bytes
-
https://huggingface.co/JTSJohnny/pipi0/resolve/main/utils/train_tokenizer.py
- Command line
-
hf download hf://JTSJohnny/pipi0/utils/train_tokenizer.py
-
curl -L -o train_tokenizer.py https://huggingface.co/JTSJohnny/pipi0/resolve/main/utils/train_tokenizer.py
564 Bytes
| from tokenizer import train_tokenizer, save_tokenizer | |
| from os import listdir | |
| from os.path import abspath, isfile, join | |
| if __name__ == "__main__": | |
| print("Training tokenizer...") | |
| files = [ | |
| abspath(join("data/rawtexts/", filename)) | |
| for filename in listdir("data/rawtexts/") | |
| if isfile(join("data/rawtexts/", filename)) | |
| ] | |
| tokenizer = train_tokenizer(files=files) | |
| print("Trained!") | |
| print("Saving to trained/tokenizer_saved") | |
| save_tokenizer(tokenizer, abspath("trained/tokenizer_saved.json")) | |
| print("Saved!") | |