Feature Extraction
Transformers
Safetensors
scripture_genome_head
scripture
multilingual
information-retrieval
semantic-search
genome-regression
frozen-encoder
custom-head
custom_code
Instructions to use chainuser1/Scripture_Genome_Multilingual_Head_BGE_M3 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use chainuser1/Scripture_Genome_Multilingual_Head_BGE_M3 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="chainuser1/Scripture_Genome_Multilingual_Head_BGE_M3", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("chainuser1/Scripture_Genome_Multilingual_Head_BGE_M3", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Download configuration_scripture_genome.py from chainuser1/Scripture_Genome_Multilingual_Head_BGE_M3: direct link, hf CLI and curl.
- Browser
- Download file 1.21 kB
-
https://huggingface.co/chainuser1/Scripture_Genome_Multilingual_Head_BGE_M3/resolve/main/configuration_scripture_genome.py
- Command line
-
hf download hf://chainuser1/Scripture_Genome_Multilingual_Head_BGE_M3/configuration_scripture_genome.py
-
curl -L -o configuration_scripture_genome.py https://huggingface.co/chainuser1/Scripture_Genome_Multilingual_Head_BGE_M3/resolve/main/configuration_scripture_genome.py
1.21 kB
| """Configuration for the Scripture Genome head (the base is separate).""" | |
| from transformers import PretrainedConfig | |
| class ScriptureGenomeConfig(PretrainedConfig): | |
| model_type = "scripture_genome_head" | |
| def __init__( | |
| self, | |
| input_dim=1024, | |
| hidden_dim=4096, | |
| output_dim=568, | |
| encoder_name="BAAI/bge-m3", | |
| encoder_revision="5617a9f61b028005a4858fdac845db406aefb181", | |
| max_length=512, | |
| checkpoint_sha256=None, | |
| gene_ids_sha256=None, | |
| track="question", | |
| **kwargs, | |
| ): | |
| super().__init__(**kwargs) | |
| if (input_dim, hidden_dim, output_dim) != (1024, 4096, 568): | |
| raise ValueError("This release supports only the selected 1024 -> 4096 -> 568 head") | |
| self.input_dim = input_dim | |
| self.hidden_dim = hidden_dim | |
| self.output_dim = output_dim | |
| self.encoder_name = encoder_name | |
| self.encoder_revision = encoder_revision | |
| self.max_length = max_length | |
| self.checkpoint_sha256 = checkpoint_sha256 | |
| self.gene_ids_sha256 = gene_ids_sha256 | |
| self.track = track | |
| self.pooling = "cls_l2_normalized" | |
| ScriptureGenomeConfig.register_for_auto_class() | |