Upload folder using huggingface_hub
Browse files
README.md
CHANGED
@@ -29,15 +29,25 @@ All models in the series achieve **GLUE benchmark scores that surpass standard B
|
|
29 |
|
30 |
## How to Get Started with the Model
|
31 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
```python
|
33 |
from transformers import AutoTokenizer, AutoModel
|
|
|
34 |
|
35 |
tokenizer = AutoTokenizer.from_pretrained("manelalab/chrono-bert-v1-19991231")
|
36 |
-
model = AutoModel.from_pretrained("manelalab/chrono-bert-v1-19991231")
|
37 |
|
38 |
text = "You've gotta be very careful not to mess with the space-time continuum. -- Dr. Brown, Back to the Future"
|
39 |
|
40 |
-
inputs = tokenizer(text, return_tensors="pt")
|
41 |
outputs = model(**inputs)
|
42 |
```
|
43 |
|
|
|
29 |
|
30 |
## How to Get Started with the Model
|
31 |
|
32 |
+
The model is compatible with the `transformers` library starting from v4.48.0:
|
33 |
+
|
34 |
+
```sh
|
35 |
+
pip install -U transformers>=4.48.0
|
36 |
+
pip install flash-attn
|
37 |
+
```
|
38 |
+
|
39 |
+
Here is an example code of using the model:
|
40 |
+
|
41 |
```python
|
42 |
from transformers import AutoTokenizer, AutoModel
|
43 |
+
device = 'cuda:0'
|
44 |
|
45 |
tokenizer = AutoTokenizer.from_pretrained("manelalab/chrono-bert-v1-19991231")
|
46 |
+
model = AutoModel.from_pretrained("manelalab/chrono-bert-v1-19991231").to(device)
|
47 |
|
48 |
text = "You've gotta be very careful not to mess with the space-time continuum. -- Dr. Brown, Back to the Future"
|
49 |
|
50 |
+
inputs = tokenizer(text, return_tensors="pt").to(device)
|
51 |
outputs = model(**inputs)
|
52 |
```
|
53 |
|