Update README.md
Browse files
README.md
CHANGED
@@ -2,19 +2,71 @@
|
|
2 |
license: cc-by-4.0
|
3 |
language:
|
4 |
- he
|
|
|
5 |
---
|
|
|
6 |
|
7 |
-
|
8 |
|
9 |
-
|
|
|
|
|
|
|
|
|
10 |
|
11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
|
13 |
-
|
14 |
-
- The model works better for tasks of information retrieval (given a paragraph and a question, to answer based on the paragraph), and of general questions (although the world knowledge is relatively limited).
|
15 |
|
16 |
-
|
|
|
|
|
17 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
|
19 |
This work is licensed under a
|
20 |
[Creative Commons Attribution 4.0 International License][cc-by].
|
@@ -23,4 +75,4 @@ This work is licensed under a
|
|
23 |
|
24 |
[cc-by]: http://creativecommons.org/licenses/by/4.0/
|
25 |
[cc-by-image]: https://i.creativecommons.org/l/by/4.0/88x31.png
|
26 |
-
[cc-by-shield]: https://img.shields.io/badge/License-CC%20BY%204.0-lightgrey.svg
|
|
|
2 |
license: cc-by-4.0
|
3 |
language:
|
4 |
- he
|
5 |
+
inference: false
|
6 |
---
|
7 |
+
# **DictaLM**: A Large Generative Language Model for Modern Hebrew
|
8 |
|
9 |
+
A large generative pretrained transformer (GPT) language model for Hebrew, released [link to be added].
|
10 |
|
11 |
+
This model was fine-tuned for instructions:
|
12 |
+
- General questions:
|
13 |
+
```
|
14 |
+
ืื ืื ืืืช ืกืคืจ?
|
15 |
+
```
|
16 |
|
17 |
+
```
|
18 |
+
ืงืืืืชื ืืชื ืงื ืืืฆืืข. ืืื ืืืจื ืื ืืื ื ืืืคื ืืื?
|
19 |
+
```
|
20 |
+
- Simple tasks:
|
21 |
+
```
|
22 |
+
ืชืฆืืข ืืื ืจืขืืื ืืช ืืคืขืืืืช ืขื ืืืืื ืื ื 5:
|
23 |
+
```
|
24 |
+
- Information retrieval from a paragraph context:
|
25 |
+
|
26 |
+
```
|
27 |
+
ืืืกืืง ืืืื ื ืืื ืืืจื ืืืกืืจืชืืช ืืืขืชืืงื ืืงืืืฃ ืืืชืื. ืฉืืื ืื ืืืจืฉืช ืืื ืืื ืจื ืืืืคื ืืืกื ืืขืืืื ืืงืืืืช ืืืฉืจืื ืืืืงืืืืช ืจืืื ืืขืืื. ืฉืืืืช ืืกืืง ืืื ื ืืืคืฉืจืืช ืืืกืืื ืขืืืืืช ืืืงืืืืช ืืื ืืื ืืืื ืืื ืืขืืืช ืืฉืืืืช ืืืืืื ืืช ืืืืื. ืืืืชืื ืืืืืขืืื ืืืืื (ืืืืืฉื, ืื ืืืื ืืืืชืื ืืฉืื) ืืชืืื ืืืชืจ ืืกืืง ืืื ื ืืืืื ืฉืืคืจื ืคืืืช ื ืคืืข ืืืืื ืืืกืืง ืืฉืืื ืื (ืคืืืขืืช ืืงืืืคืช ืืคืจื ืืืืชืื ืืฉืื ืคืืืช ืืฉืืขืืชืืืช). ืืื ืื ืืืขืืฃ ืืกืืง ืืื ื ืืืืืจืื ืืื ืืืืคืืืจืคืื ืืืงืืืืช ืื ืฆืคืืคืืช ืืขืฆืื ืื ืืืคืฉืจืื ืืืฉื ื ืืื ืืืืื ืืื ืื. ืืฉืืื ืืืื ืืช ืืืคืฉืจืช ืื ืืืกืืง ืขืฆืื ืฉืื ืื ืืืืขืืื ืฉืื ืื, ืืืชืื ืืงืฆื ืืืฉืืช ืืคืจื ืืืืขื ืืื ืขืฅ.
|
28 |
+
|
29 |
+
ืขื ืืกืืก ืืคืกืงื ืืืืช, ืื ืืื ืืืชืจืื ืฉื ืืกืืง ืืื ื ืืืืื ืช ืงืฆื ืืืฉืืช ืืคืจื?
|
30 |
+
```
|
31 |
|
32 |
+
## Sample usage:
|
|
|
33 |
|
34 |
+
```python
|
35 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
36 |
+
import torch
|
37 |
|
38 |
+
tokenizer = AutoTokenizer.from_pretrained('dicta-il/dictalm-7b-instruct')
|
39 |
+
model = AutoModelForCausalLM.from_pretrained('dicta-il/dictalm-7b-instruct', trust_remote_code=True).cuda()
|
40 |
+
|
41 |
+
model.eval()
|
42 |
+
|
43 |
+
with torch.inference_mode():
|
44 |
+
prompt = 'ืชืฆืืข ืืื ืจืขืืื ืืช ืืคืขืืืืช ืขื ืืืืื ืื ื 5:\n'
|
45 |
+
kwargs = dict(
|
46 |
+
inputs=tokenizer(prompt, return_tensors='pt').input_ids.to(model.device),
|
47 |
+
do_sample=True,
|
48 |
+
top_k=50,
|
49 |
+
top_p=0.95,
|
50 |
+
temperature=0.75,
|
51 |
+
max_length=100,
|
52 |
+
min_new_tokens=5
|
53 |
+
)
|
54 |
+
|
55 |
+
print(tokenizer.batch_decode(model.generate(**kwargs), skip_special_tokens=True))
|
56 |
+
```
|
57 |
+
|
58 |
+
|
59 |
+
## Citation
|
60 |
+
|
61 |
+
If you use DictaLM in your research, please cite ```ADD CITATION HERE```
|
62 |
+
|
63 |
+
**BibTeX:**
|
64 |
+
|
65 |
+
```ADD BIBTEXT HERE```
|
66 |
+
|
67 |
+
## License
|
68 |
+
|
69 |
+
Shield: [![CC BY 4.0][cc-by-shield]][cc-by]
|
70 |
|
71 |
This work is licensed under a
|
72 |
[Creative Commons Attribution 4.0 International License][cc-by].
|
|
|
75 |
|
76 |
[cc-by]: http://creativecommons.org/licenses/by/4.0/
|
77 |
[cc-by-image]: https://i.creativecommons.org/l/by/4.0/88x31.png
|
78 |
+
[cc-by-shield]: https://img.shields.io/badge/License-CC%20BY%204.0-lightgrey.svg
|