Views
No views yet
FishNALM-8L_pretrain is a fish-specific foundation DNA language model in the FishNALM family. It was pretrained on fish genome sequences with masked language modeling (MLM) and is intended for genomic sequence representation learning and downstream transfer to fish genomics tasks.FishNALM-8L_pretrain.The pretraining corpus was constructed from curated fish reference genomes downloaded from public databases and processed through a unified filtering and sequence preparation pipeline designed for fish genomic modeling.
1from transformers import AutoTokenizer, AutoModelForMaskedLM
2
3repo_name = "xia-lab/<REPO_NAME>"
4
5tokenizer = AutoTokenizer.from_pretrained(repo_name)
6model = AutoModelForMaskedLM.from_pretrained(repo_name)1import torch
2from transformers import AutoTokenizer, AutoModelForMaskedLM
3
4repo_name = "xia-lab/<REPO_NAME>"
5sequence = "ATGCGTACGTTAGCTAGCTAGCTAGCTAGCTA"
6
7tokenizer = AutoTokenizer.from_pretrained(repo_name)
8model = AutoModelForMaskedLM.from_pretrained(repo_name)
9
10inputs = tokenizer(
11 sequence,
12 return_tensors="pt",
13 truncation=True,
14 padding="max_length",
15 max_length=512,
16)
17
18with torch.no_grad():
19 outputs = model(**inputs, output_hidden_states=True)
20
21last_hidden_state = outputs.hidden_states[-1]
22logits = outputs.logits
23
24print(last_hidden_state.shape)
25print(logits.shape)config.jsonmodel.safetensorstokenizer.jsontokenizer_config.jsonspecial_tokens_map.jsonvocab.txtREADME.md