stefan-it/nanochat-german-data
Viewer • Updated • 51.2M • 480
This repository hosts the first base German nanochat model.
It was pretrained with a modified version of the awesome nanochat implementation from Andrej Karpathy. The model was trained on 8xA100 from Lambda.
The German nanochat model used a subset of the LLäMmlein pretraining dataset, which itself is a strict subset of the German portion of the RedPajama V2 dataset.
More information can be found in the corresponding dataset repository.
Here are some examples from the eval prompts:
- sample 0: <|bos|>Die Hauptstadt von Frankreich ist Paris. Die Stadt ist die Hauptstadt von Frankreich und hat 2,5 Millionen
- sample 1: <|bos|>Das chemische Symbol von Gold ist Ag. Es ist ein silberweißes Metall, das in der Natur in der
- sample 2: <|bos|>Wenn gestern Freitag war, dann ist morgen Freitag. Und wenn heute Freitag ist, dann ist morgen Freitag. Und wenn morgen
- sample 3: <|bos|>Das Gegenteil von heiß ist kalt
- sample 4: <|bos|>Die Planeten des Sonnensystems sind: Sonne, Mond, Merkur, Venus, Mars, Jupiter, Saturn, Uranus
- sample 5: <|bos|>Meine Lieblingsfarbe ist Blau. Ich mag es, wenn es ein bisschen wärmer ist als die anderen Farben
- sample 6: <|bos|>Wenn 5*x + 3 = 13, dann ist x = 13, dann ist 5*x + 3 = 13
Based on the evaluation dataset, here are the evaluation results:
To generate some text, please make sure that you are using this specific HF branch.
Then the following code can be used:
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
model_id = "stefan-it/nanochat-german-base"
revision = "main"
max_new_tokens = 64
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=False, revision=revision)
model = AutoModelForCausalLM.from_pretrained(model_id, trust_remote_code=False, dtype=torch.bfloat16, revision=revision).to(device)
model.eval()
prompt = "Die Altstadt von München "
generator = pipeline('text-generation', model=model, tokenizer=tokenizer, device=device, max_new_tokens=max_new_tokens)
outputs = generator(prompt)
print(outputs)
The model is licences under a permissive Apache 2.0 license.