Instructions to use Azurro/APT-1B-Base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Azurro/APT-1B-Base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Azurro/APT-1B-Base")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Azurro/APT-1B-Base") model = AutoModelForCausalLM.from_pretrained("Azurro/APT-1B-Base", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Azurro/APT-1B-Base with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Azurro/APT-1B-Base" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Azurro/APT-1B-Base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Azurro/APT-1B-Base
- SGLang
How to use Azurro/APT-1B-Base 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 "Azurro/APT-1B-Base" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Azurro/APT-1B-Base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "Azurro/APT-1B-Base" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Azurro/APT-1B-Base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Azurro/APT-1B-Base with Docker Model Runner:
docker model run hf.co/Azurro/APT-1B-Base
Commit ·
6b778ce
1
Parent(s): 869919c
Update README.md
Browse files105 unmodified lines106107108109110111112113114115116117118119120121122123124125126127105 unmodified lines* Polish Wikipedia: 970 million tokens* web crawl data: 813 million tokens## How to UseOur model is fully compatible with HuggingFace - you can use it right away.Regarding the full precision, it can be run on a graphic card with 6 GB VRAM.```pythonimport transformersmodel = transformers.AutoModelForCausalLM.from_pretrained('Azurro/APT-1B-Base')```In order to reduce the memory usage, you can use smaller precision (bfloat16) and run the model on a graphic card with 4 GB VRAM.```pythonimport transformersmodel = transformers.AutoModelForCausalLM.from_pretrained('Azurro/APT-1B-Base', torch_dtype=torch.bfloat16)```## Limitations and Biases105 unmodified lines106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143105 unmodified lines* Polish Wikipedia: 970 million tokens* web crawl data: 813 million tokens### QuickstartThis model can be easily loaded using the AutoModelForCausalLM functionality.```pythonfrom transformers import AutoTokenizer, AutoModelForCausalLMmodel_name = "Azurro/APT-1B-Base"tokenizer = AutoTokenizer.from_pretrained(model_name)model = AutoModelForCausalLM.from_pretrained(model_name)```In order to reduce the memory usage, you can use smaller precision (`bfloat16`).```pythonimport torchmodel = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype=torch.bfloat16)```And then you can use Hugging Face Pipelines to generate text.```pythonimport transformerstext = "Najważniejszym celem człowieka na ziemi jest"pipeline = transformers.pipeline("text-generation", model=model, tokenizer=tokenizer)sequences = pipeline(max_length=100, do_sample=True, top_k=10, num_return_sequences=1, eos_token_id=tokenizer.eos_token_id)for seq in sequences:print(f"Result: {seq['generated_text']}")```## Limitations and Biases
README.md+23-7