Update README.md
Browse files
README.md
CHANGED
|
@@ -42,7 +42,7 @@ A RoPE base of 500k flattens the rotary frequency spectrum, which gives MotifA1
|
|
| 42 |
## Installation
|
| 43 |
|
| 44 |
```bash
|
| 45 |
-
pip install codon-model==0.0.
|
| 46 |
```
|
| 47 |
|
| 48 |
Required artifacts:
|
|
@@ -56,6 +56,8 @@ Required artifacts:
|
|
| 56 |
|
| 57 |
### Load the model
|
| 58 |
|
|
|
|
|
|
|
| 59 |
```python
|
| 60 |
from codon.motif import MotifA1
|
| 61 |
|
|
@@ -63,16 +65,35 @@ model = MotifA1().load_pretrained('motifa1_sft.safetensors').to('cuda')
|
|
| 63 |
print(model.count_params(human_readable=True)) # -> 105.41 M
|
| 64 |
```
|
| 65 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 66 |
CPU users: replace `'cuda'` with `'cpu'`. Inference works out of the box, just slower.
|
| 67 |
|
| 68 |
### Load the tokenizer
|
| 69 |
|
|
|
|
|
|
|
| 70 |
```python
|
| 71 |
from codon.utils.tokens import PackedTokenizer
|
| 72 |
|
| 73 |
tokenizer = PackedTokenizer('motif.vocab')
|
| 74 |
```
|
| 75 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 76 |
### Streaming chat
|
| 77 |
|
| 78 |
```python
|
|
|
|
| 42 |
## Installation
|
| 43 |
|
| 44 |
```bash
|
| 45 |
+
pip install codon-model==0.0.6a2
|
| 46 |
```
|
| 47 |
|
| 48 |
Required artifacts:
|
|
|
|
| 56 |
|
| 57 |
### Load the model
|
| 58 |
|
| 59 |
+
If you have downloaded the `motifa1_sft.safetensors`, then you can load as:
|
| 60 |
+
|
| 61 |
```python
|
| 62 |
from codon.motif import MotifA1
|
| 63 |
|
|
|
|
| 65 |
print(model.count_params(human_readable=True)) # -> 105.41 M
|
| 66 |
```
|
| 67 |
|
| 68 |
+
More simply load from network:
|
| 69 |
+
|
| 70 |
+
```python
|
| 71 |
+
from codon.motif import MotifA1
|
| 72 |
+
|
| 73 |
+
model = MotifA1().from_remote().to('cuda')
|
| 74 |
+
print(model.count_params(human_readable=True)) # -> 105.41 M
|
| 75 |
+
```
|
| 76 |
+
|
| 77 |
CPU users: replace `'cuda'` with `'cpu'`. Inference works out of the box, just slower.
|
| 78 |
|
| 79 |
### Load the tokenizer
|
| 80 |
|
| 81 |
+
If you have downloaded the `motif.vocab`, then you can load as:
|
| 82 |
+
|
| 83 |
```python
|
| 84 |
from codon.utils.tokens import PackedTokenizer
|
| 85 |
|
| 86 |
tokenizer = PackedTokenizer('motif.vocab')
|
| 87 |
```
|
| 88 |
|
| 89 |
+
More simply load from network:
|
| 90 |
+
|
| 91 |
+
```python
|
| 92 |
+
from codon.motif import MotifA1Tokenizer
|
| 93 |
+
|
| 94 |
+
tokenizer = MotifA1Tokenizer().from_remote()
|
| 95 |
+
```
|
| 96 |
+
|
| 97 |
### Streaming chat
|
| 98 |
|
| 99 |
```python
|