Improve language tag
Browse filesHi! As the model is multilingual, this is a PR to add other languages than English to the language tag to improve the referencing. Note that 29 languages are announced in the README, but only 13 are explicitly listed. I was therefore only able to add these 13 languages.
README.md
CHANGED
|
@@ -1,102 +1,114 @@
|
|
| 1 |
-
---
|
| 2 |
-
library_name: transformers
|
| 3 |
-
datasets:
|
| 4 |
-
- openGPT-X/gsm8kx
|
| 5 |
-
language:
|
| 6 |
-
-
|
| 7 |
-
|
| 8 |
-
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
-
|
| 19 |
-
|
| 20 |
-
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
""
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 102 |
[Qwen research](https://huggingface.co/Qwen/Qwen2.5-3B-Instruct/blob/main/LICENSE)
|
|
|
|
| 1 |
+
---
|
| 2 |
+
library_name: transformers
|
| 3 |
+
datasets:
|
| 4 |
+
- openGPT-X/gsm8kx
|
| 5 |
+
language:
|
| 6 |
+
- zho
|
| 7 |
+
- eng
|
| 8 |
+
- fra
|
| 9 |
+
- spa
|
| 10 |
+
- por
|
| 11 |
+
- deu
|
| 12 |
+
- ita
|
| 13 |
+
- rus
|
| 14 |
+
- jpn
|
| 15 |
+
- kor
|
| 16 |
+
- vie
|
| 17 |
+
- tha
|
| 18 |
+
- ara
|
| 19 |
+
base_model:
|
| 20 |
+
- Qwen/Qwen2.5-3B-Instruct
|
| 21 |
+
pipeline_tag: text-generation
|
| 22 |
+
---
|
| 23 |
+
|
| 24 |
+
# German R1
|
| 25 |
+
|
| 26 |
+

|
| 27 |
+
|
| 28 |
+
**Introducing German-R1. We are so back!!11**
|
| 29 |
+
|
| 30 |
+
- 🇩🇪 German R1 is a reasoning model almost equivalent to OpenAI‘s o3 or DeepSeek‘s R1 - but it thinks in German!
|
| 31 |
+
|
| 32 |
+
- 🇩🇪 German R1 is so efficient that is was build without any government funding.
|
| 33 |
+
|
| 34 |
+
- 🇩🇪 German R1 was only trained with legally imported H100s in less than five minutes.
|
| 35 |
+
|
| 36 |
+
- Please do NOT take this too serious.
|
| 37 |
+
|
| 38 |
+
## Context
|
| 39 |
+
|
| 40 |
+

|
| 41 |
+
|
| 42 |
+
See Linkedin: https://www.linkedin.com/posts/activity-7294337496023269376-ZBkI
|
| 43 |
+
|
| 44 |
+
## Usage
|
| 45 |
+
|
| 46 |
+
You can run the model as follows:
|
| 47 |
+
|
| 48 |
+
```python
|
| 49 |
+
from transformers import pipeline, set_seed
|
| 50 |
+
import json
|
| 51 |
+
|
| 52 |
+
set_seed(42)
|
| 53 |
+
pipe = pipeline("text-generation", "malteos/german-r1")
|
| 54 |
+
|
| 55 |
+
# from gsm8k test set
|
| 56 |
+
question = "James beschließt, 3-mal pro Woche 3 Sprints zu laufen. Er läuft 60 Meter pro Sprint. Wie viele Meter läuft er insgesamt pro Woche?"
|
| 57 |
+
expected_answer = "540"
|
| 58 |
+
|
| 59 |
+
# xml reasoning and answer format
|
| 60 |
+
system_prompt = """
|
| 61 |
+
Antworte auf deutsch und in diesem Format:
|
| 62 |
+
<reasoning>
|
| 63 |
+
...
|
| 64 |
+
</reasoning>
|
| 65 |
+
<answer>
|
| 66 |
+
...
|
| 67 |
+
</answer>
|
| 68 |
+
"""
|
| 69 |
+
|
| 70 |
+
messages = [
|
| 71 |
+
{
|
| 72 |
+
"role": "system",
|
| 73 |
+
"content": system_prompt,
|
| 74 |
+
},
|
| 75 |
+
{"role": "user", "content": dataset["question"][3]},
|
| 76 |
+
]
|
| 77 |
+
response = pipe(messages, max_new_tokens=256)
|
| 78 |
+
|
| 79 |
+
print(json.dumps(response, indent=4, ensure_ascii=False))
|
| 80 |
+
```
|
| 81 |
+
|
| 82 |
+
The output should look like this (correct answer: 540)
|
| 83 |
+
|
| 84 |
+
```json
|
| 85 |
+
[
|
| 86 |
+
{
|
| 87 |
+
"generated_text": [
|
| 88 |
+
{
|
| 89 |
+
"role": "system",
|
| 90 |
+
"content": "\nAntworte auf deutsch und in diesem Format:\n<reasoning>\n...\n</reasoning>\n<answer>\n...\n</answer>\n"
|
| 91 |
+
},
|
| 92 |
+
{
|
| 93 |
+
"role": "user",
|
| 94 |
+
"content": "James beschließt, 3-mal pro Woche 3 Sprints zu laufen. Er läuft 60 Meter pro Sprint. Wie viele Meter läuft er insgesamt pro Woche?"
|
| 95 |
+
},
|
| 96 |
+
{
|
| 97 |
+
"role": "assistant",
|
| 98 |
+
"content": "<reasoning>\nJames läuft 3 Sprints pro Tag, wobei jeder Sprint 60 Meter beträgt. Deshalb läuft er pro Tag 3 Sprints * 60 Meter/Sprint = 180 Meter. James läuft 3 Mal pro Woche, also läuft er insgesamt 180 Meter * 3 = 540 Meter pro Woche.\n</reasoning>\n<answer>\n540\n</answer>\n"
|
| 99 |
+
}
|
| 100 |
+
]
|
| 101 |
+
}
|
| 102 |
+
]
|
| 103 |
+
```
|
| 104 |
+
|
| 105 |
+
## Training details
|
| 106 |
+
|
| 107 |
+
- Base model: Qwen2.5-3B-Instruct
|
| 108 |
+
- Implementation: based on [GRPO demo](https://gist.github.com/willccbb/4676755236bb08cab5f4e54a0475d6fb) by [will brown](https://x.com/willccbb) + language identification reward
|
| 109 |
+
- Training data: German subset of [openGPT-X/gsm8kx](https://huggingface.co/datasets/openGPT-X/gsm8kx/) (machine translated from the English gsm8k)
|
| 110 |
+
|
| 111 |
+
|
| 112 |
+
## License
|
| 113 |
+
|
| 114 |
[Qwen research](https://huggingface.co/Qwen/Qwen2.5-3B-Instruct/blob/main/LICENSE)
|