Instructions to use AI-Sweden-Models/gpt-sw3-40b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use AI-Sweden-Models/gpt-sw3-40b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="AI-Sweden-Models/gpt-sw3-40b")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("AI-Sweden-Models/gpt-sw3-40b") model = AutoModelForCausalLM.from_pretrained("AI-Sweden-Models/gpt-sw3-40b", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use AI-Sweden-Models/gpt-sw3-40b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "AI-Sweden-Models/gpt-sw3-40b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "AI-Sweden-Models/gpt-sw3-40b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/AI-Sweden-Models/gpt-sw3-40b
- SGLang
How to use AI-Sweden-Models/gpt-sw3-40b 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 "AI-Sweden-Models/gpt-sw3-40b" \ --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": "AI-Sweden-Models/gpt-sw3-40b", "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 "AI-Sweden-Models/gpt-sw3-40b" \ --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": "AI-Sweden-Models/gpt-sw3-40b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use AI-Sweden-Models/gpt-sw3-40b with Docker Model Runner:
docker model run hf.co/AI-Sweden-Models/gpt-sw3-40b
.gguf
Any chance to make .gguf version available?
There is another thread on this as well: https://huggingface.co/AI-Sweden-Models/gpt-sw3-20b-instruct-4bit-gptq/discussions/3#65bab0765d2ef0a4b2e0fbb3
Unfortunately no solution yet it seams...
@Xouthos & @d1r3nc we added some models in the gguf format and working on more
Base models GGUF
GPT-Sw3 126M GGUF | GPT-Sw3 356M GGUF | GPT-Sw3 1.3B GGUF
GPT-Sw3 6.7B GGUF | GPT-Sw3 6.7B v2 GGUF
Instruct models GGUF
GPT-Sw3 126M Instruct GGUF | GPT-Sw3 356M Instruct GGUF | GPT-Sw3 1.3B Instruct GGUF
GPT-Sw3 6.7B v2 Instruct GGUF