Instructions to use anton-l/gpt-j-tiny-random with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use anton-l/gpt-j-tiny-random with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="anton-l/gpt-j-tiny-random")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("anton-l/gpt-j-tiny-random") model = AutoModelForCausalLM.from_pretrained("anton-l/gpt-j-tiny-random") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use anton-l/gpt-j-tiny-random with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "anton-l/gpt-j-tiny-random" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "anton-l/gpt-j-tiny-random", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/anton-l/gpt-j-tiny-random
- SGLang
How to use anton-l/gpt-j-tiny-random with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "anton-l/gpt-j-tiny-random" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "anton-l/gpt-j-tiny-random", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "anton-l/gpt-j-tiny-random" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "anton-l/gpt-j-tiny-random", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use anton-l/gpt-j-tiny-random with Docker Model Runner:
docker model run hf.co/anton-l/gpt-j-tiny-random
rust_weights
Add rust_model.ot model weights.
This is particularly of use for testing GPT-J implementation in Rust.
See related PR
Beside, is this model licensed under the Apache 2.0 like gpt-j-6b from EleutherAI ?
@lerouxrgd maybe it makes sense to just set up another repo for the rust weights? Because the model here is literally just a dummy one, with a minimally working config and randomly initialized weights π It was intended for unit-testing the transformers implementation
Yes I am well aware that the weights are literally random :D But this is fine, as it would serve the same purpose that is unit testing but for the Rust implementation. It's actually quite useful to have small weights for such tests, and I think that having the Python/Rust weights together makes it clear that the unit tests are correct (I intend to compare the final logits in Rust with the final logits in Python, when using the same model weights).
For some other models the Rust weights are being stored in the same repo:
https://huggingface.co/sentence-transformers/distiluse-base-multilingual-cased/discussions/1
I intend to add the Rust weights to EleutherAI's gpt-j-6b repo too once the unit tests are complete.