Yak-hbdx commited on
Commit
f0b56f3
1 Parent(s): 2b7842a

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +32 -1
README.md CHANGED
@@ -7,4 +7,35 @@ license: gpl-3.0
7
 
8
  This model has been pushed to the Hub using the [PytorchModelHubMixin](https://huggingface.co/docs/huggingface_hub/package_reference/mixins#huggingface_hub.PyTorchModelHubMixin) integration:
9
  - Library: [More Information Needed]
10
- - Docs: [More Information Needed]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
 
8
  This model has been pushed to the Hub using the [PytorchModelHubMixin](https://huggingface.co/docs/huggingface_hub/package_reference/mixins#huggingface_hub.PyTorchModelHubMixin) integration:
9
  - Library: [More Information Needed]
10
+ - Docs: [More Information Needed]
11
+
12
+ ## Steps to run model
13
+ - First install [transforna](https://github.com/gitHBDX/TransfoRNA/tree/master)
14
+ - Example code:
15
+ ```
16
+ from transforna import GeneEmbeddModel,RnaTokenizer
17
+ import torch
18
+ model_name = 'Seq-Struct'
19
+ model_path = f"HBDX/{model_name}-TransfoRNA"
20
+
21
+ #load model and tokenizer
22
+ model = GeneEmbeddModel.from_pretrained(model_path)
23
+ model.eval()
24
+
25
+ #init tokenizer.
26
+ tokenizer = RnaTokenizer.from_pretrained(model_path,model_name=model_name)
27
+ output = tokenizer(['AAAGTCGGAGGTTCGAAGACGATCAGATAC','TTTTCGGAACTGAGGCCATGATTAAGAGGG'])
28
+
29
+ #inference
30
+ #gene_embedds and second input embedds are the latent space representation of the input sequence and the reverse of the input sequence.
31
+ gene_embedd, second_input_embedd, activations,attn_scores_first,attn_scores_second = \
32
+ model(output['input_ids'])
33
+
34
+
35
+ #get sub class labels
36
+ sub_class_labels = model.convert_ids_to_labels(activations)
37
+
38
+ #get major class labels
39
+ major_class_labels = model.convert_subclass_to_majorclass(sub_class_labels)
40
+
41
+ ```