Push model using huggingface_hub.
Browse files- README.md +4 -39
- config.json +5 -2
- model.safetensors +2 -2
README.md
CHANGED
|
@@ -7,42 +7,7 @@ tags:
|
|
| 7 |
- pytorch_model_hub_mixin
|
| 8 |
---
|
| 9 |
|
| 10 |
-
#
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
## Website
|
| 15 |
-
|
| 16 |
-
<https://gsfm.maayanlab.cloud/>
|
| 17 |
-
|
| 18 |
-
## Usage
|
| 19 |
-
|
| 20 |
-
```bash
|
| 21 |
-
# install gsfm python library from its source on huggingface
|
| 22 |
-
GIT_LFS_SKIP_SMUDGE=1 pip install git+https://huggingface.co/maayanlab/gsfm
|
| 23 |
-
```
|
| 24 |
-
|
| 25 |
-
```python
|
| 26 |
-
import torch
|
| 27 |
-
from gsfm import Vocab, GSFM
|
| 28 |
-
|
| 29 |
-
# load gsfm vocabulary and model weights
|
| 30 |
-
vocab = Vocab.from_pretrained('maayanlab/gsfm')
|
| 31 |
-
gsfm = GSFM.from_pretrained('maayanlab/gsfm')
|
| 32 |
-
|
| 33 |
-
# convert gene symbols into token ids
|
| 34 |
-
token_ids = torch.tensor(vocab(['ACE1', 'ACE2']))[None, :]
|
| 35 |
-
|
| 36 |
-
# use model to predict missing genes from the set
|
| 37 |
-
logits = torch.squeeze(gsfm(token_ids))
|
| 38 |
-
top_10 = sorted(zip(logits, vocab.vocab))[-10:]
|
| 39 |
-
top_10
|
| 40 |
-
|
| 41 |
-
# get gene embedding
|
| 42 |
-
gene_embeddings = gsfm.embedding(token_ids)
|
| 43 |
-
gene_embeddings
|
| 44 |
-
|
| 45 |
-
# get model middle layer
|
| 46 |
-
gene_set_encoding = gsfm.encode(token_ids)
|
| 47 |
-
gene_set_encoding
|
| 48 |
-
```
|
|
|
|
| 7 |
- pytorch_model_hub_mixin
|
| 8 |
---
|
| 9 |
|
| 10 |
+
This model has been pushed to the Hub using the [PytorchModelHubMixin](https://huggingface.co/docs/huggingface_hub/package_reference/mixins#huggingface_hub.PyTorchModelHubMixin) integration:
|
| 11 |
+
- Code: [More Information Needed]
|
| 12 |
+
- Paper: [More Information Needed]
|
| 13 |
+
- Docs: [More Information Needed]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
config.json
CHANGED
|
@@ -1,5 +1,8 @@
|
|
| 1 |
{
|
| 2 |
-
"d_model":
|
| 3 |
"depth": 2,
|
| 4 |
-
"
|
|
|
|
|
|
|
|
|
|
| 5 |
}
|
|
|
|
| 1 |
{
|
| 2 |
+
"d_model": 256,
|
| 3 |
"depth": 2,
|
| 4 |
+
"dropout": 0.2,
|
| 5 |
+
"partition": 0,
|
| 6 |
+
"vocab_size": 19400,
|
| 7 |
+
"weighted_loss": "none"
|
| 8 |
}
|
model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7c8a81e269a652481e0fc1846f43eb4ab28c62a0e97c0f48e929a2425ee98921
|
| 3 |
+
size 60465656
|