Instructions to use HBDX/Seq-Struct-TransfoRNA with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use HBDX/Seq-Struct-TransfoRNA with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("HBDX/Seq-Struct-TransfoRNA", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files6 unmodified lines789106 unmodified linesThis model has been pushed to the Hub using the [PytorchModelHubMixin](https://huggingface.co/docs/huggingface_hub/package_reference/mixins#huggingface_hub.PyTorchModelHubMixin) integration:- Library: [More Information Needed]- Docs: [More Information Needed]6 unmodified lines789101112131415161718192021222324252627282930313233343536373839404142436 unmodified linesThis model has been pushed to the Hub using the [PytorchModelHubMixin](https://huggingface.co/docs/huggingface_hub/package_reference/mixins#huggingface_hub.PyTorchModelHubMixin) integration:- Library: [More Information Needed]- Docs: [More Information Needed]## Steps to run model- First install [transforna](https://github.com/gitHBDX/TransfoRNA/tree/master)- Example code:```from transforna import GeneEmbeddModel,RnaTokenizerimport torchmodel_name = 'Seq-Struct'model_path = f"HBDX/{model_name}-TransfoRNA"#load model and tokenizermodel = GeneEmbeddModel.from_pretrained(model_path)model.eval()#init tokenizer. Tokenizer will automatically get secondary structure of sequence using Vienna RNA packagetokenizer = RnaTokenizer.from_pretrained(model_path,model_name=model_name)output = tokenizer(['AAAGTCGGAGGTTCGAAGACGATCAGATAC','TTTTCGGAACTGAGGCCATGATTAAGAGGG'])#inference#gene_embedds and second input embedds are the latent space representation of the input sequence and the second input respectively.#In this case, the second input would be the secondary structure of the sequencegene_embedd, second_input_embedd, activations,attn_scores_first,attn_scores_second = \model(output['input_ids'])#get sub class labelssub_class_labels = model.convert_ids_to_labels(activations)#get major class labelsmajor_class_labels = model.convert_subclass_to_majorclass(sub_class_labels)```
README.md+34-1