Text Generation
Transformers
Safetensors
qwen2
llama-factory
full
Generated from Trainer
conversational
text-generation-inference
Instructions to use Albert-CAC/agent2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Albert-CAC/agent2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Albert-CAC/agent2") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Albert-CAC/agent2") model = AutoModelForCausalLM.from_pretrained("Albert-CAC/agent2", device_map="auto") 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 Albert-CAC/agent2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Albert-CAC/agent2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Albert-CAC/agent2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Albert-CAC/agent2
- SGLang
How to use Albert-CAC/agent2 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 "Albert-CAC/agent2" \ --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": "Albert-CAC/agent2", "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 "Albert-CAC/agent2" \ --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": "Albert-CAC/agent2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Albert-CAC/agent2 with Docker Model Runner:
docker model run hf.co/Albert-CAC/agent2
| {"current_steps": 5, "total_steps": 57, "loss": 0.3072, "lr": 4.9394909565685894e-05, "epoch": 0.2702702702702703, "percentage": 8.77, "elapsed_time": "0:00:43", "remaining_time": "0:07:37", "throughput": 13383.84, "total_tokens": 588672} | |
| {"current_steps": 10, "total_steps": 57, "loss": 0.2503, "lr": 4.698684378016222e-05, "epoch": 0.5405405405405406, "percentage": 17.54, "elapsed_time": "0:01:24", "remaining_time": "0:06:37", "throughput": 14068.84, "total_tokens": 1191152} | |
| {"current_steps": 15, "total_steps": 57, "loss": 0.1434, "lr": 4.2919562829211283e-05, "epoch": 0.8108108108108109, "percentage": 26.32, "elapsed_time": "0:02:04", "remaining_time": "0:05:48", "throughput": 14381.98, "total_tokens": 1792128} | |
| {"current_steps": 20, "total_steps": 57, "loss": 0.119, "lr": 3.7500000000000003e-05, "epoch": 1.054054054054054, "percentage": 35.09, "elapsed_time": "0:02:40", "remaining_time": "0:04:56", "throughput": 14571.51, "total_tokens": 2338720} | |
| {"current_steps": 25, "total_steps": 57, "loss": 0.0704, "lr": 3.1137137178519985e-05, "epoch": 1.3243243243243243, "percentage": 43.86, "elapsed_time": "0:03:21", "remaining_time": "0:04:17", "throughput": 14636.56, "total_tokens": 2944992} | |
| {"current_steps": 30, "total_steps": 57, "loss": 0.0714, "lr": 2.4311141440795953e-05, "epoch": 1.5945945945945947, "percentage": 52.63, "elapsed_time": "0:04:00", "remaining_time": "0:03:36", "throughput": 14708.19, "total_tokens": 3543936} | |
| {"current_steps": 35, "total_steps": 57, "loss": 0.0651, "lr": 1.7537129724957642e-05, "epoch": 1.864864864864865, "percentage": 61.4, "elapsed_time": "0:04:40", "remaining_time": "0:02:56", "throughput": 14752.82, "total_tokens": 4133600} | |
| {"current_steps": 40, "total_steps": 57, "loss": 0.0524, "lr": 1.1326296046939333e-05, "epoch": 2.108108108108108, "percentage": 70.18, "elapsed_time": "0:05:16", "remaining_time": "0:02:14", "throughput": 14775.3, "total_tokens": 4674192} | |
| {"current_steps": 45, "total_steps": 57, "loss": 0.0349, "lr": 6.147334755577596e-06, "epoch": 2.3783783783783785, "percentage": 78.95, "elapsed_time": "0:05:57", "remaining_time": "0:01:35", "throughput": 14759.9, "total_tokens": 5271408} | |
| {"current_steps": 50, "total_steps": 57, "loss": 0.028, "lr": 2.391070982560564e-06, "epoch": 2.6486486486486487, "percentage": 87.72, "elapsed_time": "0:06:35", "remaining_time": "0:00:55", "throughput": 14788.33, "total_tokens": 5854528} | |
| {"current_steps": 55, "total_steps": 57, "loss": 0.0241, "lr": 3.4096741493194197e-07, "epoch": 2.918918918918919, "percentage": 96.49, "elapsed_time": "0:07:17", "remaining_time": "0:00:15", "throughput": 14784.67, "total_tokens": 6461216} | |
| {"current_steps": 57, "total_steps": 57, "epoch": 3.0, "percentage": 100.0, "elapsed_time": "0:10:03", "remaining_time": "0:00:00", "throughput": 11009.88, "total_tokens": 6642400} | |