Text Generation
Transformers
PyTorch
GGUF
llama
Generated from Trainer
conversational
text-generation-inference
Instructions to use msaavedra1234/tiny_t with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use msaavedra1234/tiny_t with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="msaavedra1234/tiny_t") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("msaavedra1234/tiny_t") model = AutoModelForCausalLM.from_pretrained("msaavedra1234/tiny_t") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - llama-cpp-python
How to use msaavedra1234/tiny_t with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="msaavedra1234/tiny_t", filename="ggml-model-f16.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use msaavedra1234/tiny_t with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf msaavedra1234/tiny_t:F16 # Run inference directly in the terminal: llama-cli -hf msaavedra1234/tiny_t:F16
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf msaavedra1234/tiny_t:F16 # Run inference directly in the terminal: llama-cli -hf msaavedra1234/tiny_t:F16
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf msaavedra1234/tiny_t:F16 # Run inference directly in the terminal: ./llama-cli -hf msaavedra1234/tiny_t:F16
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf msaavedra1234/tiny_t:F16 # Run inference directly in the terminal: ./build/bin/llama-cli -hf msaavedra1234/tiny_t:F16
Use Docker
docker model run hf.co/msaavedra1234/tiny_t:F16
- LM Studio
- Jan
- vLLM
How to use msaavedra1234/tiny_t with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "msaavedra1234/tiny_t" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "msaavedra1234/tiny_t", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/msaavedra1234/tiny_t:F16
- SGLang
How to use msaavedra1234/tiny_t 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 "msaavedra1234/tiny_t" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "msaavedra1234/tiny_t", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "msaavedra1234/tiny_t" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "msaavedra1234/tiny_t", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use msaavedra1234/tiny_t with Ollama:
ollama run hf.co/msaavedra1234/tiny_t:F16
- Unsloth Studio new
How to use msaavedra1234/tiny_t with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for msaavedra1234/tiny_t to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for msaavedra1234/tiny_t to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for msaavedra1234/tiny_t to start chatting
- Docker Model Runner
How to use msaavedra1234/tiny_t with Docker Model Runner:
docker model run hf.co/msaavedra1234/tiny_t:F16
- Lemonade
How to use msaavedra1234/tiny_t with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull msaavedra1234/tiny_t:F16
Run and chat with the model
lemonade run user.tiny_t-F16
List all available models
lemonade list
# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("msaavedra1234/tiny_t")
model = AutoModelForCausalLM.from_pretrained("msaavedra1234/tiny_t")
messages = [
{"role": "user", "content": "Who are you?"},
]
inputs = tokenizer.apply_chat_template(
messages,
add_generation_prompt=True,
tokenize=True,
return_dict=True,
return_tensors="pt",
).to(model.device)
outputs = model.generate(**inputs, max_new_tokens=40)
print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:]))Quick Links
See axolotl config
axolotl version: 0.3.0
base_model: TinyLlama/TinyLlama-1.1B-Chat-v1.0
model_type: LlamaForCausalLM
tokenizer_type: LlamaTokenizer
is_llama_derived_model: true
eval_sample_packing: False #Poco dato
load_in_8bit: false
load_in_4bit: false
strict: false
datasets:
- path: data.json # or json
ds_type: json # see other options below
type: completion
dataset_prepared_path:
val_set_size: 0.05
# output_dir: ./lora-out
sequence_len: 4096
sample_packing: true
pad_to_sequence_len: true
# adapter: lora
# lora_model_dir:
# lora_r: 32
# lora_alpha: 16
# lora_dropout: 0.05
# lora_target_linear: true
# lora_fan_in_fan_out:
wandb_project:
wandb_entity:
wandb_watch:
wandb_name:
wandb_log_model:
output_dir: ./tinyllama-out
gradient_accumulation_steps: 4
micro_batch_size: 2
num_epochs: 8 #2
optimizer: adamw_bnb_8bit
lr_scheduler: cosine
learning_rate: 0.0002
train_on_inputs: false
group_by_length: false
bf16: true
fp16: false #TODO: change to true
tf32: false
gradient_checkpointing: true
early_stopping_patience:
resume_from_checkpoint:
local_rank:
logging_steps: 1
xformers_attention:
flash_attention: true
save_strategy: "no"
warmup_steps: 10
evals_per_epoch: 4
# saves_per_epoch: 1
debug:
deepspeed:
weight_decay: 0.0
fsdp:
fsdp_config:
special_tokens:
tinyllama-out
This model is a fine-tuned version of TinyLlama/TinyLlama-1.1B-Chat-v1.0 on the None dataset. It achieves the following results on the evaluation set:
- Loss: 1.8806
Model description
More information needed
Intended uses & limitations
More information needed
Training and evaluation data
More information needed
Training procedure
Training hyperparameters
The following hyperparameters were used during training:
- learning_rate: 0.0002
- train_batch_size: 2
- eval_batch_size: 2
- seed: 42
- gradient_accumulation_steps: 4
- total_train_batch_size: 8
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
- lr_scheduler_type: cosine
- lr_scheduler_warmup_steps: 10
- num_epochs: 8
Training results
| Training Loss | Epoch | Step | Validation Loss |
|---|---|---|---|
| 1.9894 | 0.13 | 1 | 1.5790 |
| 1.915 | 0.26 | 2 | 1.4849 |
| 1.642 | 0.52 | 4 | 1.4032 |
| 1.5396 | 0.77 | 6 | 1.4059 |
| 1.3746 | 1.03 | 8 | 1.4101 |
| 0.9355 | 1.23 | 10 | 1.5147 |
| 0.9266 | 1.48 | 12 | 1.5291 |
| 0.8006 | 1.74 | 14 | 1.4724 |
| 0.7664 | 2.0 | 16 | 1.4965 |
| 0.4813 | 2.16 | 18 | 1.5715 |
| 0.4193 | 2.42 | 20 | 1.5436 |
| 0.364 | 2.68 | 22 | 1.6040 |
| 0.3592 | 2.94 | 24 | 1.5823 |
| 0.1884 | 3.13 | 26 | 1.6850 |
| 0.159 | 3.39 | 28 | 1.8316 |
| 0.1641 | 3.65 | 30 | 1.7286 |
| 0.1512 | 3.9 | 32 | 1.7029 |
| 0.1563 | 4.06 | 34 | 1.7033 |
| 0.0696 | 4.32 | 36 | 1.7482 |
| 0.0643 | 4.58 | 38 | 1.8069 |
| 0.0662 | 4.84 | 40 | 1.8410 |
| 0.0709 | 5.1 | 42 | 1.8529 |
| 0.0344 | 5.26 | 44 | 1.8626 |
| 0.0468 | 5.52 | 46 | 1.8716 |
| 0.0328 | 5.77 | 48 | 1.8761 |
| 0.0353 | 6.03 | 50 | 1.8789 |
| 0.0375 | 6.23 | 52 | 1.8803 |
| 0.0345 | 6.48 | 54 | 1.8802 |
| 0.0346 | 6.74 | 56 | 1.8806 |
Framework versions
- Transformers 4.37.0.dev0
- Pytorch 2.0.1
- Datasets 2.16.1
- Tokenizers 0.15.0
- Downloads last month
- 34
Hardware compatibility
Log In to add your hardware
16-bit
Model tree for msaavedra1234/tiny_t
Base model
TinyLlama/TinyLlama-1.1B-Chat-v1.0
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="msaavedra1234/tiny_t") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)