LemiSt commited on
Commit
a0a20a4
·
verified ·
1 Parent(s): 0243946

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +21 -5
README.md CHANGED
@@ -91,21 +91,37 @@ special_tokens:
91
 
92
  # SmolLM-135M-instruct-de
93
 
94
- This model is a fine-tuned version of [LemiSt/SmolLM-135M-de](https://huggingface.co/LemiSt/SmolLM-135M-de) on the None dataset.
95
  It achieves the following results on the evaluation set:
96
  - Loss: 0.7453
97
 
98
  ## Model description
99
 
100
- More information needed
101
 
102
  ## Intended uses & limitations
103
 
104
- More information needed
105
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
106
  ## Training and evaluation data
107
 
108
- More information needed
109
 
110
  ## Training procedure
111
 
 
91
 
92
  # SmolLM-135M-instruct-de
93
 
94
+ This model is a fine-tuned version of [LemiSt/SmolLM-135M-de](https://huggingface.co/LemiSt/SmolLM-135M-de) on an internal testing dataset with general chat examples.
95
  It achieves the following results on the evaluation set:
96
  - Loss: 0.7453
97
 
98
  ## Model description
99
 
100
+ For more information, see the mode card of the [base model](https://huggingface.co/LemiSt/SmolLM-135M-de). This adapter was trained using qlora at rank 32 with alpha 16, applying a dataset of around 200k german chat samples for two epochs.
101
 
102
  ## Intended uses & limitations
103
 
104
+ Mainly playing around with tiny chat models - while the output is generally intact German and the model somewhat follows instructions, it makes too many mistakes to be deployed in a real world setting.
105
+
106
+ ### Usage example
107
+ ```python
108
+ import torch
109
+ from transformers import AutoTokenizer, AutoModelForCausalLM
110
+ checkpoint = "LemiSt/SmolLM-135M-instruct-de"
111
+ tokenizer = AutoTokenizer.from_pretrained(checkpoint)
112
+ device = "cuda" if torch.cuda.is_available() else "cpu"
113
+ model = AutoModelForCausalLM.from_pretrained(checkpoint, device_map=device, torch_dtype=torch.bfloat16)
114
+ messages = [
115
+ {"role": "system", "content": "Du bist ein hilfreicher Assistent."},
116
+ {"role": "user", "content": "Wie viele Hände hat ein normaler Mensch?"}
117
+ ]
118
+ inputs = tokenizer.apply_chat_template(messages, tokenize=True, return_tensors="pt", add_generation_prompt=True).to(device)
119
+ outputs = model.generate(inputs, max_new_tokens=256, do_sample=True, temperature=0.5, top_p=0.9)
120
+ print(tokenizer.decode(outputs[0][inputs.shape[1]:], skip_special_tokens=True))
121
+ ```
122
  ## Training and evaluation data
123
 
124
+ Internal dataset which was compiled for another experiment.
125
 
126
  ## Training procedure
127