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
| timestamp,project_name,run_id,duration,emissions,emissions_rate,cpu_power,gpu_power,ram_power,cpu_energy,gpu_energy,ram_energy,energy_consumed,country_name,country_iso_code,region,cloud_provider,cloud_region,os,python_version,codecarbon_version,cpu_count,cpu_model,gpu_count,gpu_model,longitude,latitude,ram_total_size,tracking_mode,on_cloud,pue | |
| 2024-01-18T02:02:26,TeenyTinyLlama,39b206a4-e86a-41fa-a5f9-44deef6d7e34,49516.08560705185,2.5308193028462096,5.1111053545916445e-05,42.5,279.50887502416805,31.303916931152344,0.5845638546203586,4.576422722524138,0.43049185652675864,5.591478433671226,United States,USA,iowa,,,Linux-6.1.58+-x86_64-with-glibc2.35,3.10.12,2.3.2,12,Intel(R) Xeon(R) CPU @ 2.20GHz,1,1 x NVIDIA A100-SXM4-40GB,-95.8517,41.2591,83.47711181640625,machine,N,1.0 | |