This model is a
fully merged fp16 checkpoint fine-tuned from
unsloth/embeddinggemma-300m — Unsloth's optimized mirror of Google's
EmbeddingGemma-300M — for feature-extraction tasks, specifically dense Information Retrieval (IR) in the electrical and electronics engineering domain. The LoRA adapter weights have been merged into the base model and saved as full fp16
.safetensors weights, making this the most compatible variant for the Hugging Face ecosystem (Sentence Transformers, vLLM, Text Embeddings Inference, etc.).
The model was trained on the
disham993/ElectricalElectronicsIR dataset — 20,000 question-passage pairs covering electrical engineering, electronics, power systems, and communications.
1# Install dependencies
2pip install sentence-transformers torch
1import torch
2import torch.nn.functional as F
3from sentence_transformers import SentenceTransformer
4
5# === SEMANTIC SEARCH EXAMPLE ===
6if __name__ == "__main__":
7 print("Downloading and Booting Engine...")
8
9 # SentenceTransformers flawlessly supports this repository natively!
10 model = SentenceTransformer("disham993/electrical-electronics-gemma-ir_finetune_16bit")
11
12 query = "How do transformers step up voltage?"
13
14 # A miniature corpus of engineering documents
15 documents = [
16 "Ohm's law defines the relationship between voltage, current, and resistance.",
17 "AC circuits use alternating current which changes direction periodically.",
18 "A step-up transformer has more turns on its secondary coil than its primary, increasing voltage.",
19 "Capacitors store electrical energy in an electric field.",
20 "Inductors resist changes in electric current passing through them.",
21 "Transformers operate on Faraday's law of induction to transfer energy between circuits.",
22 "Diodes allow current to pass in only one direction.",
23 "Voltage is the electric potential difference between two points."
24 ]
25
26 print("Extracting Embeddings...")
27 # Convert texts directly to PyTorch tensors
28 query_emb = model.encode(query, convert_to_tensor=True)
29 doc_embs = model.encode(documents, convert_to_tensor=True)
30
31 # Calculate similarities natively
32 similarities = F.cosine_similarity(query_emb.unsqueeze(0), doc_embs)
33
34 # Retrieve the top 3 highest scoring documents
35 top_3_idx = torch.topk(similarities, k=3).indices.tolist()
36
37 print(f"\n--- Top 3 Documents for Query: '{query}' ---")
38 for rank, idx in enumerate(top_3_idx, 1):
39 print(f"Rank {rank} (Score: {similarities[idx]:.4f}) | {documents[idx]}")
While this model performs exceptionally well in the electrical and electronics engineering domain, it is not designed for use in other domains. Additionally, it may:
This model is intended for research, educational, and production IR applications in the electrical engineering domain.
For the complete fine-tuning and evaluation pipeline — from data loading to GGUF export — refer to the
GitHub repository and the notebooks
Finetuning_EmbeddingGemma_EEIR_RTX_5090.ipynb and
Evaluate_All_Models.ipynb.
1@misc{electrical-embeddinggemma-ir,
2 author = {disham993},
3 title = {Electrical \& Electronics Engineering Embedding Models},
4 year = {2026},
5 howpublished = {\url{https://huggingface.co/collections/disham993/electrical-and-electronics-engineering-embedding-models}},
6}