Upload T5/generate-dict-embeddingsT5.py with huggingface_hub
Browse files
T5/generate-dict-embeddingsT5.py
CHANGED
|
@@ -56,7 +56,7 @@ all_embeddings = []
|
|
| 56 |
|
| 57 |
for word in tokendict:
|
| 58 |
emb = embed_from_text(word)
|
| 59 |
-
|
| 60 |
all_embeddings.append(emb)
|
| 61 |
count+=1
|
| 62 |
if (count %100) ==0:
|
|
|
|
| 56 |
|
| 57 |
for word in tokendict:
|
| 58 |
emb = embed_from_text(word)
|
| 59 |
+
emb=emb.unsqueeze(0) # stupid matrix magic to make torch.cat work
|
| 60 |
all_embeddings.append(emb)
|
| 61 |
count+=1
|
| 62 |
if (count %100) ==0:
|