boriszverkov commited on
Commit
5959fed
·
verified ·
1 Parent(s): 8f2361e

Added code example

Browse files
Files changed (1) hide show
  1. README.md +20 -0
README.md CHANGED
@@ -48,6 +48,26 @@ The model was trained for 1.5 epochs over 12 days on the [LUMI supercomputer](ht
48
 
49
  This model serves as a multilingual base LLM, suitable for instruction tuning, research, and language understanding tasks in low- and high-resource European languages.
50
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
51
  ### License
52
 
53
  Apache 2.0 — free for research and commercial use, subject to the terms.
 
48
 
49
  This model serves as a multilingual base LLM, suitable for instruction tuning, research, and language understanding tasks in low- and high-resource European languages.
50
 
51
+
52
+ ### Use with transformers
53
+
54
+ Quick start with `Transformers` both for GPU and CPU enabled envs:
55
+
56
+ ```python
57
+ from transformers import AutoTokenizer, AutoModelForCausalLM, pipeline
58
+ import torch
59
+
60
+ model_name = "minilingua-ai/MiniLingua-1b"
61
+
62
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
63
+ model = AutoModelForCausalLM.from_pretrained(model_name, device_map="auto", dtype=torch.float16)
64
+ gen = pipeline("text-generation", model=model, tokenizer=tokenizer, trust_remote_code=True)
65
+
66
+ prompt = "Translate from Bulgarian: Здравейте! Как сте? Translation:"
67
+ out = gen(prompt, max_new_tokens=128, do_sample=False)
68
+ print(out[0])
69
+ ```
70
+
71
  ### License
72
 
73
  Apache 2.0 — free for research and commercial use, subject to the terms.