Text Generation
Transformers
PyTorch
Safetensors
GGUF
Norwegian
Norwegian Bokmål
Norwegian Nynorsk
bloom
feature-extraction
gpt
generative
text-generation-inference
Instructions to use norallm/norbloom-7b-scratch with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use norallm/norbloom-7b-scratch with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="norallm/norbloom-7b-scratch")# Load model directly from transformers import AutoTokenizer, AutoModel tokenizer = AutoTokenizer.from_pretrained("norallm/norbloom-7b-scratch") model = AutoModel.from_pretrained("norallm/norbloom-7b-scratch", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use norallm/norbloom-7b-scratch with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf norallm/norbloom-7b-scratch:Q4_K_M # Run inference directly in the terminal: llama cli -hf norallm/norbloom-7b-scratch:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf norallm/norbloom-7b-scratch:Q4_K_M # Run inference directly in the terminal: llama cli -hf norallm/norbloom-7b-scratch:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf norallm/norbloom-7b-scratch:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf norallm/norbloom-7b-scratch:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf norallm/norbloom-7b-scratch:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf norallm/norbloom-7b-scratch:Q4_K_M
Use Docker
docker model run hf.co/norallm/norbloom-7b-scratch:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use norallm/norbloom-7b-scratch with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "norallm/norbloom-7b-scratch" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "norallm/norbloom-7b-scratch", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/norallm/norbloom-7b-scratch:Q4_K_M
- SGLang
How to use norallm/norbloom-7b-scratch 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 "norallm/norbloom-7b-scratch" \ --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": "norallm/norbloom-7b-scratch", "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 "norallm/norbloom-7b-scratch" \ --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": "norallm/norbloom-7b-scratch", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Ollama
How to use norallm/norbloom-7b-scratch with Ollama:
ollama run hf.co/norallm/norbloom-7b-scratch:Q4_K_M
- Unsloth Desktop
- Docker Model Runner
How to use norallm/norbloom-7b-scratch with Docker Model Runner:
docker model run hf.co/norallm/norbloom-7b-scratch:Q4_K_M
- Lemonade
How to use norallm/norbloom-7b-scratch with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull norallm/norbloom-7b-scratch:Q4_K_M
Run and chat with the model
lemonade run user.norbloom-7b-scratch-Q4_K_M
List all available models
lemonade list
- Atomic Chat
added results on grammatical error correction
Browse files
README.md
CHANGED
|
@@ -93,7 +93,7 @@ We release [our codebase here](https://github.com/ltgoslo/norallm). We compare a
|
|
| 93 |
We use the binary formulation of this task (positive vs. negative).
|
| 94 |
|
| 95 |
<details>
|
| 96 |
-
<summary>Method</summary>
|
| 97 |
|
| 98 |
* Evaluation setting: zero-shot and few-shot perplexity-based evaluation.
|
| 99 |
* Prompt: ```"Tekst: {text}\nSentiment:{label}"```, where the ```label``` is either "positiv" or "negativ".
|
|
@@ -126,7 +126,7 @@ We use the binary formulation of this task (positive vs. negative).
|
|
| 126 |
[NorQuAD](https://huggingface.co/datasets/ltg/norquad) ([Ivanova et al., 2023](https://aclanthology.org/2023.nodalida-1.17/)) is a dataset for extractive question answering in Norwegian designed similarly to [SQuAD (Rajpurkar et al., 2016)](https://aclanthology.org/D16-1264/).
|
| 127 |
|
| 128 |
<details>
|
| 129 |
-
<summary>Method</summary>
|
| 130 |
|
| 131 |
* Evaluation setting: zero-shot and few-shot settings via natural language generation using the greedy decoding strategy.
|
| 132 |
* Prompt: ```"Tittel: {title}\n\nTekst: {text}\n\nSpørsmål: {question}\n\nSvar:{answer}"``` Based on [Brown et al. (2020)](https://arxiv.org/abs/2005.14165).
|
|
@@ -153,13 +153,45 @@ We use the binary formulation of this task (positive vs. negative).
|
|
| 153 |
</details>
|
| 154 |
|
| 155 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 156 |
|
| 157 |
### Machine translation
|
| 158 |
|
| 159 |
[Tatoeba](https://huggingface.co/datasets/Helsinki-NLP/tatoeba_mt) [(Tiedemann, 2020)](https://aclanthology.org/2020.wmt-1.139/) is a benchmark for machine translation, which includes hundreds of language pairs. We consider six language pairs (English <-> Bokmål, English <-> Nynorsk, and Bokmål <-> Nynorsk).
|
| 160 |
|
| 161 |
<details>
|
| 162 |
-
<summary>Method</summary>
|
| 163 |
|
| 164 |
* Evaluation setting: zero-shot and few-shot settings via natural language generation using the greedy decoding strategy.
|
| 165 |
* Prompt: ```"{source_language}: {source_text}\n{target_language}:{target_text}"```, where the ```source_language``` and ```target_language``` are ```Engelsk```, ```Bokmål```, or ```Nynorsk```. Based on [Garcia et al. (2023)](https://arxiv.org/abs/2302.01398).
|
|
|
|
| 93 |
We use the binary formulation of this task (positive vs. negative).
|
| 94 |
|
| 95 |
<details>
|
| 96 |
+
<summary>Method (click to expand)</summary>
|
| 97 |
|
| 98 |
* Evaluation setting: zero-shot and few-shot perplexity-based evaluation.
|
| 99 |
* Prompt: ```"Tekst: {text}\nSentiment:{label}"```, where the ```label``` is either "positiv" or "negativ".
|
|
|
|
| 126 |
[NorQuAD](https://huggingface.co/datasets/ltg/norquad) ([Ivanova et al., 2023](https://aclanthology.org/2023.nodalida-1.17/)) is a dataset for extractive question answering in Norwegian designed similarly to [SQuAD (Rajpurkar et al., 2016)](https://aclanthology.org/D16-1264/).
|
| 127 |
|
| 128 |
<details>
|
| 129 |
+
<summary>Method (click to expand)</summary>
|
| 130 |
|
| 131 |
* Evaluation setting: zero-shot and few-shot settings via natural language generation using the greedy decoding strategy.
|
| 132 |
* Prompt: ```"Tittel: {title}\n\nTekst: {text}\n\nSpørsmål: {question}\n\nSvar:{answer}"``` Based on [Brown et al. (2020)](https://arxiv.org/abs/2005.14165).
|
|
|
|
| 153 |
</details>
|
| 154 |
|
| 155 |
|
| 156 |
+
### Grammatical error correction
|
| 157 |
+
|
| 158 |
+
[ASK-RAW](https://huggingface.co/datasets/ltg/ask-gec) is dataset for Norwegian grammatical error correction (GEC) created by [Matias Jentoft (2023)](https://www.duo.uio.no/handle/10852/103885).
|
| 159 |
+
|
| 160 |
+
<details>
|
| 161 |
+
<summary>Method (click to expand)</summary>
|
| 162 |
+
|
| 163 |
+
* Evaluation setting: zero-shot and few-shot settings via natural language generation using the greedy decoding strategy.
|
| 164 |
+
* Prompt: ```"Her er eksempler på perfekt korrigering av grammatiske feil:\n\nTekst: {source_text}\nKorreksjon:{target_text}"```
|
| 165 |
+
* Few-shot results show the average scores across 5 repetitions
|
| 166 |
+
* Evaluation script: https://github.com/ltgoslo/norallm/blob/main/initial_evaluation/gec.py
|
| 167 |
+
* Performance metrics: the evaluation metric uses [ERRANT](https://github.com/chrisjbryant/errant/tree/main), which identifies edit-spans and then calculates the F_{0.5} scores between the gold edits and predicted edits.
|
| 168 |
+
|
| 169 |
+
</details>
|
| 170 |
+
|
| 171 |
+
<details open>
|
| 172 |
+
<summary>Results on [the ASK corpus](https://huggingface.co/datasets/ltg/ask-gec) (ERRANT F_{0.5})</summary>
|
| 173 |
+
|
| 174 |
+
|Model|0-shot (F0.5)|1-shot (F0.5)|32-shot (F0.5)|
|
| 175 |
+
|---|---|---|---|
|
| 176 |
+
|NorMistral-7b-warm|**40.8**|41.8|48.5|
|
| 177 |
+
|NorMistral-7b-scratch|22.1|28.8|42.1|
|
| 178 |
+
|NorBLOOM-7b|8.7|24.5|32.0|
|
| 179 |
+
|NB-GPT-J|9.1|28.2|30.6|
|
| 180 |
+
|GPT-Sw3-6.7B|30.5|42.9|**50.6**|
|
| 181 |
+
|GPT-Sw3-6.7B-v2|40.6|**43.4**|49.8|
|
| 182 |
+
|Falcon-7B|10.8|12.4|15.5|
|
| 183 |
+
|Mistral-7B-v0.1|26.0|27.4|30.6|
|
| 184 |
+
|
| 185 |
+
</details>
|
| 186 |
+
|
| 187 |
+
|
| 188 |
|
| 189 |
### Machine translation
|
| 190 |
|
| 191 |
[Tatoeba](https://huggingface.co/datasets/Helsinki-NLP/tatoeba_mt) [(Tiedemann, 2020)](https://aclanthology.org/2020.wmt-1.139/) is a benchmark for machine translation, which includes hundreds of language pairs. We consider six language pairs (English <-> Bokmål, English <-> Nynorsk, and Bokmål <-> Nynorsk).
|
| 192 |
|
| 193 |
<details>
|
| 194 |
+
<summary>Method (click to expand)</summary>
|
| 195 |
|
| 196 |
* Evaluation setting: zero-shot and few-shot settings via natural language generation using the greedy decoding strategy.
|
| 197 |
* Prompt: ```"{source_language}: {source_text}\n{target_language}:{target_text}"```, where the ```source_language``` and ```target_language``` are ```Engelsk```, ```Bokmål```, or ```Nynorsk```. Based on [Garcia et al. (2023)](https://arxiv.org/abs/2302.01398).
|