Update README.md
Browse files
README.md
CHANGED
@@ -72,11 +72,15 @@ European Championship => competitions
|
|
72 |
|
73 |
If you want to use flash attention or increase sequence length, please, check the following code:
|
74 |
```python
|
75 |
-
|
|
|
|
|
|
|
76 |
_attn_implementation = 'flash_attention_2',
|
77 |
-
max_len = 2048).to('cuda:0')
|
78 |
```
|
79 |
|
|
|
80 |
If you have a large amount of entities and want to pre-embed them, please, refer to the following code snippet:
|
81 |
|
82 |
```python
|
|
|
72 |
|
73 |
If you want to use flash attention or increase sequence length, please, check the following code:
|
74 |
```python
|
75 |
+
from gliner import GLiNER
|
76 |
+
import torch
|
77 |
+
|
78 |
+
model = GLiNER.from_pretrained("knowledgator/gliner-qwen-1.5B-v1.0",
|
79 |
_attn_implementation = 'flash_attention_2',
|
80 |
+
max_len = 2048).to('cuda:0', dtype=torch.float16)
|
81 |
```
|
82 |
|
83 |
+
|
84 |
If you have a large amount of entities and want to pre-embed them, please, refer to the following code snippet:
|
85 |
|
86 |
```python
|