Text Generation
Transformers
Safetensors
llama
notram
norwegian
bokmål
nynorsk
multilingual
conversational
text-generation-inference
Instructions to use NbAiLab/nb-notram-llama-3.1-8b-instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use NbAiLab/nb-notram-llama-3.1-8b-instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="NbAiLab/nb-notram-llama-3.1-8b-instruct") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("NbAiLab/nb-notram-llama-3.1-8b-instruct") model = AutoModelForCausalLM.from_pretrained("NbAiLab/nb-notram-llama-3.1-8b-instruct", 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 NbAiLab/nb-notram-llama-3.1-8b-instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "NbAiLab/nb-notram-llama-3.1-8b-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": "NbAiLab/nb-notram-llama-3.1-8b-instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/NbAiLab/nb-notram-llama-3.1-8b-instruct
- SGLang
How to use NbAiLab/nb-notram-llama-3.1-8b-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 "NbAiLab/nb-notram-llama-3.1-8b-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": "NbAiLab/nb-notram-llama-3.1-8b-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 "NbAiLab/nb-notram-llama-3.1-8b-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": "NbAiLab/nb-notram-llama-3.1-8b-instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use NbAiLab/nb-notram-llama-3.1-8b-instruct with Docker Model Runner:
docker model run hf.co/NbAiLab/nb-notram-llama-3.1-8b-instruct
Update README.md
Browse files
README.md
CHANGED
|
@@ -6,6 +6,7 @@ language:
|
|
| 6 |
- "en" # English
|
| 7 |
tags:
|
| 8 |
- "llama"
|
|
|
|
| 9 |
- "norwegian"
|
| 10 |
- "bokmål"
|
| 11 |
- "nynorsk"
|
|
@@ -18,16 +19,16 @@ base_model: "meta-llama/Llama-3.1-8B-Instruct"
|
|
| 18 |
library_name: "transformers"
|
| 19 |
---
|
| 20 |
|
| 21 |
-
## Model Card: "
|
| 22 |
|
| 23 |
### Model overview
|
| 24 |
|
| 25 |
-
"
|
| 26 |
https://huggingface.co/meta-llama/Llama-3.1-8B-Instruct
|
| 27 |
|
| 28 |
The model is fine-tuned to improve instruction-following behavior in Norwegian Bokmål and Norwegian Nynorsk, while aiming to preserve strong English performance.
|
| 29 |
|
| 30 |
-
This
|
| 31 |
|
| 32 |
---
|
| 33 |
|
|
@@ -94,7 +95,7 @@ This is a research release. For end-user deployments, we recommend careful evalu
|
|
| 94 |
import torch
|
| 95 |
from transformers import pipeline
|
| 96 |
|
| 97 |
-
model_id = "NbAiLab/nb-llama-3.1-
|
| 98 |
|
| 99 |
pipe = pipeline(
|
| 100 |
task="text-generation",
|
|
@@ -198,4 +199,4 @@ Model training and documentation: **Per Egil Kummervold**.
|
|
| 198 |
|
| 199 |
## Funding and acknowledgement
|
| 200 |
|
| 201 |
-
Training was supported by Google’s TPU Research Cloud ("TRC"), which provided Cloud TPUs essential for the computational work.
|
|
|
|
| 6 |
- "en" # English
|
| 7 |
tags:
|
| 8 |
- "llama"
|
| 9 |
+
- "notram"
|
| 10 |
- "norwegian"
|
| 11 |
- "bokmål"
|
| 12 |
- "nynorsk"
|
|
|
|
| 19 |
library_name: "transformers"
|
| 20 |
---
|
| 21 |
|
| 22 |
+
## Model Card: "nb-notram-llama-3.1-8b-instruct"
|
| 23 |
|
| 24 |
### Model overview
|
| 25 |
|
| 26 |
+
"NbAiLab/nb-notram-llama-3.1-8b-instruct" is part of the "NB-Llama-3.x" series (covering "Llama 3.1", "Llama 3.2", and "Llama 3.3" based releases) and the "NoTraM" line of work, trained on top of Meta’s "Llama-3.1-8B-Instruct":
|
| 27 |
https://huggingface.co/meta-llama/Llama-3.1-8B-Instruct
|
| 28 |
|
| 29 |
The model is fine-tuned to improve instruction-following behavior in Norwegian Bokmål and Norwegian Nynorsk, while aiming to preserve strong English performance.
|
| 30 |
|
| 31 |
+
This release is an experiment in how far modern open-weight models can be adapted for Norwegian using **only publicly available data**. Although trained at the National Library of Norway, it does **not** include material that is only accessible through legal deposit. It may include public documents (for example governmental reports) that are publicly available and also part of legal deposit collections.
|
| 32 |
|
| 33 |
---
|
| 34 |
|
|
|
|
| 95 |
import torch
|
| 96 |
from transformers import pipeline
|
| 97 |
|
| 98 |
+
model_id = "NbAiLab/nb-notram-llama-3.1-8b-instruct"
|
| 99 |
|
| 100 |
pipe = pipeline(
|
| 101 |
task="text-generation",
|
|
|
|
| 199 |
|
| 200 |
## Funding and acknowledgement
|
| 201 |
|
| 202 |
+
Training was supported by Google’s TPU Research Cloud ("TRC"), which provided Cloud TPUs essential for the computational work.
|