Instructions to use TinyPixel/tinyllama-random with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use TinyPixel/tinyllama-random with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="TinyPixel/tinyllama-random")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("TinyPixel/tinyllama-random") model = AutoModelForCausalLM.from_pretrained("TinyPixel/tinyllama-random") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use TinyPixel/tinyllama-random with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "TinyPixel/tinyllama-random" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "TinyPixel/tinyllama-random", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/TinyPixel/tinyllama-random
- SGLang
How to use TinyPixel/tinyllama-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 "TinyPixel/tinyllama-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": "TinyPixel/tinyllama-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 "TinyPixel/tinyllama-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": "TinyPixel/tinyllama-random", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use TinyPixel/tinyllama-random with Docker Model Runner:
docker model run hf.co/TinyPixel/tinyllama-random
Upload folder using huggingface_hub
Browse files- config.json +8 -8
- model.safetensors +2 -2
config.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
{
|
| 2 |
-
"_name_or_path": "TinyPixel/
|
| 3 |
"architectures": [
|
| 4 |
"LlamaForCausalLM"
|
| 5 |
],
|
|
@@ -7,19 +7,19 @@
|
|
| 7 |
"bos_token_id": 1,
|
| 8 |
"eos_token_id": 2,
|
| 9 |
"hidden_act": "silu",
|
| 10 |
-
"hidden_size":
|
| 11 |
"initializer_range": 0.02,
|
| 12 |
-
"intermediate_size":
|
| 13 |
-
"max_position_embeddings":
|
| 14 |
"model_type": "llama",
|
| 15 |
-
"num_attention_heads":
|
| 16 |
-
"num_hidden_layers":
|
| 17 |
-
"num_key_value_heads":
|
| 18 |
"pretraining_tp": 1,
|
| 19 |
"rms_norm_eps": 1e-05,
|
| 20 |
"rope_scaling": null,
|
| 21 |
"rope_theta": 10000.0,
|
| 22 |
-
"tie_word_embeddings":
|
| 23 |
"torch_dtype": "float32",
|
| 24 |
"transformers_version": "4.35.2",
|
| 25 |
"use_cache": true,
|
|
|
|
| 1 |
{
|
| 2 |
+
"_name_or_path": "TinyPixel/small-llama",
|
| 3 |
"architectures": [
|
| 4 |
"LlamaForCausalLM"
|
| 5 |
],
|
|
|
|
| 7 |
"bos_token_id": 1,
|
| 8 |
"eos_token_id": 2,
|
| 9 |
"hidden_act": "silu",
|
| 10 |
+
"hidden_size": 16,
|
| 11 |
"initializer_range": 0.02,
|
| 12 |
+
"intermediate_size": 64,
|
| 13 |
+
"max_position_embeddings": 256,
|
| 14 |
"model_type": "llama",
|
| 15 |
+
"num_attention_heads": 4,
|
| 16 |
+
"num_hidden_layers": 2,
|
| 17 |
+
"num_key_value_heads": 4,
|
| 18 |
"pretraining_tp": 1,
|
| 19 |
"rms_norm_eps": 1e-05,
|
| 20 |
"rope_scaling": null,
|
| 21 |
"rope_theta": 10000.0,
|
| 22 |
+
"tie_word_embeddings": false,
|
| 23 |
"torch_dtype": "float32",
|
| 24 |
"transformers_version": "4.35.2",
|
| 25 |
"use_cache": true,
|
model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:507e649be0be3aef1027b607abf455c9e9d7b68a60505191ae816937ed2281b2
|
| 3 |
+
size 4131280
|