Update README.md
Browse files
README.md
CHANGED
|
@@ -34,7 +34,7 @@ The model was trained on word-definition pairs from a dictionary corpus using:
|
|
| 34 |
## Installation
|
| 35 |
|
| 36 |
```bash
|
| 37 |
-
pip install torch numpy
|
| 38 |
```
|
| 39 |
|
| 40 |
## Usage
|
|
@@ -45,9 +45,13 @@ pip install torch numpy
|
|
| 45 |
import torch
|
| 46 |
import numpy as np
|
| 47 |
import torch.nn.functional as F
|
|
|
|
|
|
|
|
|
|
|
|
|
| 48 |
|
| 49 |
# Load the pre-computed character embeddings
|
| 50 |
-
char_embeddings = np.load(
|
| 51 |
|
| 52 |
# Convert to tensor for efficient operations
|
| 53 |
char_embedding_tensor = {}
|
|
|
|
| 34 |
## Installation
|
| 35 |
|
| 36 |
```bash
|
| 37 |
+
pip install torch numpy huggingface_hub
|
| 38 |
```
|
| 39 |
|
| 40 |
## Usage
|
|
|
|
| 45 |
import torch
|
| 46 |
import numpy as np
|
| 47 |
import torch.nn.functional as F
|
| 48 |
+
from huggingface_hub import hf_hub_download
|
| 49 |
+
|
| 50 |
+
# Example for downloading a single file
|
| 51 |
+
local_path = hf_hub_download(repo_id="npc0/CharEmb", filename="char_embeddings_best.npy")
|
| 52 |
|
| 53 |
# Load the pre-computed character embeddings
|
| 54 |
+
char_embeddings = np.load(local_path, allow_pickle=True).item()
|
| 55 |
|
| 56 |
# Convert to tensor for efficient operations
|
| 57 |
char_embedding_tensor = {}
|