Update README.md
Browse files
README.md
CHANGED
@@ -2,4 +2,90 @@
|
|
2 |
license: other
|
3 |
license_name: gemma-terms-of-use
|
4 |
license_link: https://ai.google.dev/gemma/terms
|
|
|
|
|
|
|
|
|
5 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
license: other
|
3 |
license_name: gemma-terms-of-use
|
4 |
license_link: https://ai.google.dev/gemma/terms
|
5 |
+
language:
|
6 |
+
- en
|
7 |
+
- he
|
8 |
+
library_name: transformers
|
9 |
---
|
10 |
+
# Hebrew-Gemma-11B
|
11 |
+
|
12 |
+
- **Base Model:** [Hebrew-Gemma-11B](yam-peleg/Hebrew-Gemma-11B)
|
13 |
+
- **Instruct Model:** [Hebrew-Gemma-11B-Instruct](yam-peleg/Hebrew-Gemma-11B-Instruct)
|
14 |
+
|
15 |
+
Hebrew-Gemma-11B is an open-source Large Language Model (LLM) is a hebrew/english pretrained generative text model with 11 billion parameters, based on the Gemma-7B architecture from Google.
|
16 |
+
|
17 |
+
It is continued pretrain of gemma-7b, extended to a larger scale and trained on 3B additional tokens of both English and Hebrew text data.
|
18 |
+
|
19 |
+
The resulting model Gemma-11B is a powerful general-purpose language model suitable for a wide range of natural language processing tasks, with a focus on Hebrew language understanding and generation.
|
20 |
+
|
21 |
+
|
22 |
+
### Terms of Use
|
23 |
+
|
24 |
+
As an extention of Gemma-7B, this model is subject to the original license and terms of use by Google.
|
25 |
+
|
26 |
+
**Gemma-7B original Terms of Use**: [Terms](https://www.kaggle.com/models/google/gemma/license/consent)
|
27 |
+
|
28 |
+
### Usage
|
29 |
+
|
30 |
+
Below are some code snippets on how to get quickly started with running the model.
|
31 |
+
|
32 |
+
First make sure to `pip install -U transformers`, then copy the snippet from the section that is relevant for your usecase.
|
33 |
+
|
34 |
+
### Running on CPU
|
35 |
+
|
36 |
+
```python
|
37 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
38 |
+
|
39 |
+
tokenizer = AutoTokenizer.from_pretrained("yam-peleg/Hebrew-Gemma-11B")
|
40 |
+
model = AutoModelForCausalLM.from_pretrained("yam-peleg/Hebrew-Gemma-11B")
|
41 |
+
|
42 |
+
input_text = "ืฉืืื! ืื ืฉืืืื ืืืื?"
|
43 |
+
input_ids = tokenizer(input_text, return_tensors="pt")
|
44 |
+
|
45 |
+
outputs = model.generate(**input_ids)
|
46 |
+
print(tokenizer.decode(outputs[0]))
|
47 |
+
```
|
48 |
+
|
49 |
+
### Running on GPU
|
50 |
+
|
51 |
+
```python
|
52 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
53 |
+
|
54 |
+
tokenizer = AutoTokenizer.from_pretrained("yam-peleg/Hebrew-Gemma-11B")
|
55 |
+
model = AutoModelForCausalLM.from_pretrained("yam-peleg/Hebrew-Gemma-11B", device_map="auto")
|
56 |
+
|
57 |
+
input_text = "ืฉืืื! ืื ืฉืืืื ืืืื?"
|
58 |
+
input_ids = tokenizer(input_text, return_tensors="pt").to("cuda")
|
59 |
+
|
60 |
+
outputs = model.generate(**input_ids)
|
61 |
+
print(tokenizer.decode(outputs[0]))
|
62 |
+
```
|
63 |
+
|
64 |
+
### Running with 4-Bit precision
|
65 |
+
|
66 |
+
```python
|
67 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig
|
68 |
+
|
69 |
+
tokenizer = AutoTokenizer.from_pretrained("yam-peleg/Hebrew-Gemma-11B")
|
70 |
+
model = AutoModelForCausalLM.from_pretrained("yam-peleg/Hebrew-Gemma-11B", quantization_config = BitsAndBytesConfig(load_in_4bit=True))
|
71 |
+
|
72 |
+
input_text = "ืฉืืื! ืื ืฉืืืื ืืืื?"
|
73 |
+
input_ids = tokenizer(input_text, return_tensors="pt").to("cuda")
|
74 |
+
|
75 |
+
outputs = model.generate(**input_ids)
|
76 |
+
print(tokenizer.decode(outputs[0])
|
77 |
+
```
|
78 |
+
|
79 |
+
### Benchmark Results
|
80 |
+
|
81 |
+
- Coming Soon!
|
82 |
+
|
83 |
+
|
84 |
+
### Notice
|
85 |
+
|
86 |
+
Hebrew-Gemma-11B is a pretrained base model and therefore does not have any moderation mechanisms.
|
87 |
+
|
88 |
+
|
89 |
+
### Author
|
90 |
+
|
91 |
+
Trained by Yam Peleg.
|