Update README.md
Browse files
README.md
CHANGED
|
@@ -50,18 +50,14 @@ Download all files from the repository into a single folder and run the notebook
|
|
| 50 |
### Loading the Model
|
| 51 |
|
| 52 |
```python
|
|
|
|
| 53 |
import torch
|
| 54 |
from safetensors import safe_open
|
| 55 |
from model import Transformer as Model
|
| 56 |
from transformers import PreTrainedTokenizerFast
|
| 57 |
|
| 58 |
-
config
|
| 59 |
-
|
| 60 |
-
'num_heads': 12,
|
| 61 |
-
'vocab_size': 32768,
|
| 62 |
-
'input_dims': 768,
|
| 63 |
-
'hidden_dims': 3072,
|
| 64 |
-
}
|
| 65 |
|
| 66 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 67 |
torch.set_default_device(device)
|
|
|
|
| 50 |
### Loading the Model
|
| 51 |
|
| 52 |
```python
|
| 53 |
+
import json
|
| 54 |
import torch
|
| 55 |
from safetensors import safe_open
|
| 56 |
from model import Transformer as Model
|
| 57 |
from transformers import PreTrainedTokenizerFast
|
| 58 |
|
| 59 |
+
with open("./config.json", "r") as f:
|
| 60 |
+
config = json.load(f)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 61 |
|
| 62 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 63 |
torch.set_default_device(device)
|