u8sand commited on
Commit
37bae66
·
verified ·
1 Parent(s): 33326b2

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +28 -4
README.md CHANGED
@@ -7,7 +7,31 @@ tags:
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]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  - pytorch_model_hub_mixin
8
  ---
9
 
10
+ ## Website
11
+
12
+ <https://gsfm.maayanlab.cloud/>
13
+
14
+ ## Usage
15
+
16
+ ```python
17
+ import torch
18
+
19
+ vocab = Vocab.from_pretrained('maayanlab/gsfm')
20
+ model = GSFM.from_pretrained('maayanlab/gsfm')
21
+
22
+ # convert gene symbols into token ids
23
+ token_ids = torch.tensor(vocab(['ACE1', 'ACE2']))[None, :]
24
+
25
+ # use model to predict missing genes from the set
26
+ logits = torch.squeeze(model(token_ids))
27
+ top_10 = sorted(zip(logits, vocab.vocab))[-10:]
28
+ top_10
29
+
30
+ # get gene embedding
31
+ gene_embeddings = model.embedding(token_ids)
32
+ gene_embeddings
33
+
34
+ # get model middle layer
35
+ gene_set_encoding = model.encode(token_ids)
36
+ gene_set_encoding
37
+ ```