Text Generation
Transformers
Safetensors
Portuguese
llama
alignment
instruction tuned
text generation
conversation
assistant
conversational
text-generation-inference
4-bit precision
awq
Instructions to use nicholasKluge/TeenyTinyLlama-460m-Chat-awq with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use nicholasKluge/TeenyTinyLlama-460m-Chat-awq with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="nicholasKluge/TeenyTinyLlama-460m-Chat-awq") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForMultimodalLM tokenizer = AutoTokenizer.from_pretrained("nicholasKluge/TeenyTinyLlama-460m-Chat-awq") model = AutoModelForMultimodalLM.from_pretrained("nicholasKluge/TeenyTinyLlama-460m-Chat-awq") 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]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use nicholasKluge/TeenyTinyLlama-460m-Chat-awq with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "nicholasKluge/TeenyTinyLlama-460m-Chat-awq" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "nicholasKluge/TeenyTinyLlama-460m-Chat-awq", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/nicholasKluge/TeenyTinyLlama-460m-Chat-awq
- SGLang
How to use nicholasKluge/TeenyTinyLlama-460m-Chat-awq 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 "nicholasKluge/TeenyTinyLlama-460m-Chat-awq" \ --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": "nicholasKluge/TeenyTinyLlama-460m-Chat-awq", "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 "nicholasKluge/TeenyTinyLlama-460m-Chat-awq" \ --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": "nicholasKluge/TeenyTinyLlama-460m-Chat-awq", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use nicholasKluge/TeenyTinyLlama-460m-Chat-awq with Docker Model Runner:
docker model run hf.co/nicholasKluge/TeenyTinyLlama-460m-Chat-awq
Update generation_config.json
Browse files- generation_config.json +8 -10
generation_config.json
CHANGED
|
@@ -1,16 +1,14 @@
|
|
| 1 |
{
|
| 2 |
"bos_token_id": 1,
|
| 3 |
-
"do_sample": true,
|
| 4 |
"eos_token_id": 2,
|
| 5 |
-
"max_new_tokens": 2048,
|
| 6 |
"pad_token_id": 3,
|
|
|
|
|
|
|
| 7 |
"renormalize_logits": true,
|
| 8 |
"repetition_penalty": 1.2,
|
| 9 |
-
"
|
| 10 |
-
"
|
| 11 |
-
"
|
| 12 |
-
"
|
| 13 |
-
"transformers_version": "4.
|
| 14 |
-
|
| 15 |
-
"use_cache": false
|
| 16 |
-
}
|
|
|
|
| 1 |
{
|
| 2 |
"bos_token_id": 1,
|
|
|
|
| 3 |
"eos_token_id": 2,
|
|
|
|
| 4 |
"pad_token_id": 3,
|
| 5 |
+
"do_sample": true,
|
| 6 |
+
"max_new_tokens": 1024,
|
| 7 |
"renormalize_logits": true,
|
| 8 |
"repetition_penalty": 1.2,
|
| 9 |
+
"temperature": 0.1,
|
| 10 |
+
"top_k": 50,
|
| 11 |
+
"top_p": 1.0,
|
| 12 |
+
"use_cache": true,
|
| 13 |
+
"transformers_version": "4.42.3"
|
| 14 |
+
}
|
|
|
|
|
|