Text Generation
Transformers
PyTorch
Safetensors
Portuguese
llama
text-generation-inference
conversational
Eval Results (legacy)
Instructions to use TucanoBR/Tucano-2b4-Instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use TucanoBR/Tucano-2b4-Instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="TucanoBR/Tucano-2b4-Instruct") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("TucanoBR/Tucano-2b4-Instruct") model = AutoModelForCausalLM.from_pretrained("TucanoBR/Tucano-2b4-Instruct") 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 TucanoBR/Tucano-2b4-Instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "TucanoBR/Tucano-2b4-Instruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "TucanoBR/Tucano-2b4-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/TucanoBR/Tucano-2b4-Instruct
- SGLang
How to use TucanoBR/Tucano-2b4-Instruct 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 "TucanoBR/Tucano-2b4-Instruct" \ --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": "TucanoBR/Tucano-2b4-Instruct", "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 "TucanoBR/Tucano-2b4-Instruct" \ --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": "TucanoBR/Tucano-2b4-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use TucanoBR/Tucano-2b4-Instruct with Docker Model Runner:
docker model run hf.co/TucanoBR/Tucano-2b4-Instruct
Upload emissions-2b4-instruct.csv with huggingface_hub
Browse files
emissions-2b4-instruct.csv
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
timestamp,project_name,run_id,experiment_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,n_nodes
|
| 2 |
+
2024-11-06T19:20:52,Tucano-sft,5f0d1e08-8524-40ab-adeb-92401acb0afa,5b0fa12a-3dd7-45bb-9766-cc326314d9f1,31672.27382905176,9.94885293271022,0.0003141186826815232,112.5,1402.2599449871632,1462.5000000000002,0.9897571840361336,12.270581318401753,12.855563670314986,26.115902172752907,Germany,DEU,north rhine-westphalia,,,Linux-5.14.0-284.30.1.el9_2.x86_64-x86_64-with-glibc2.34,3.11.3,2.7.1,512,AMD EPYC 7713 64-Core Processor,4,4 x NVIDIA A100-SXM4-80GB,7.1178,50.7246,3900,machine,N,1.0,4
|
| 3 |
+
2024-11-09T17:17:45,Tucano-dpo,6121fbd2-bea2-4942-8000-ac07bf388c86,5b0fa12a-3dd7-45bb-9766-cc326314d9f1,12777.643057700712,2.476683906212117,0.0001938294797427051,112.5,351.3174231090531,365.62500000000006,0.39930072949185036,4.805598554475765,1.2964366031884842,6.501335887156102,Germany,DEU,north rhine-westphalia,,,Linux-5.14.0-284.30.1.el9_2.x86_64-x86_64-with-glibc2.34,3.11.3,2.7.2,128,AMD EPYC 7713 64-Core Processor,4,4 x NVIDIA A100-SXM4-80GB,7.1178,50.7246,975,machine,N,1.0,1
|