/ Модель

Характеристики

Контекст
2 048 токенов
Параметры
303 млн
Лицензия
MIT
Архитектура
gemma3_text · dense
Опубликована
18 апр 2026

electrical-embeddinggemma-ir_f16

ЭмбеддингиТекст → embedding3 профессии

Текстовая модель Gemma 3 для семантического поиска по материалам электротехники и электроники, поставляемая в формате GGUF F16.

156скачиваний за 30 дней1лайквеса обновлены19 апр 2026

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

Модель disham993/electrical-embeddinggemma-ir_f16 — версия семейства Gemma 3 Text для семантического поиска и извлечения информации в электротехнике и электронике. Её разработал пользователь disham993, дообучив unsloth/embeddinggemma-300m на наборе ElectricalElectronicsIR с парами вопросов и фрагментов текста по электротехнике, электронике, энергосистемам и связи. Модель содержит около 302,8 млн параметров и принимает текстовые запросы и фрагменты документов, преобразуя их в признаки для поиска.

Это сборка GGUF в формате F16 для запуска через llama.cpp, в том числе на CPU и GPU; заявленная длина контекста — 2048 токенов. README приводит высокие результаты поиска на тестовой выборке из 2000 запросов, но они относятся к набору ElectricalElectronicsIR. Модель ориентирована на английский текст и может хуже работать с другими языками, разговорными формулировками и запросами, смешивающими электротехнику с другими областями. Лицензия — MIT.

Сценарии применения

  • семантический поиск по технической документации в электротехнике
  • поиск фрагментов по вопросам об электронике и энергосистемах
  • извлечение релевантных материалов для RAG по электротехнической тематике

Ограничения

Модель предназначена для электротехнической и электронной тематики; на нерелевантных областях, неанглийском тексте и разговорных запросах качество может снижаться. GPU-ускорение требует сборки llama-cpp-python с поддержкой CUDA; на CPU инференс медленнее.

Для каких профессий подходит3

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

electrical-embeddinggemma-ir_f16

Model Description

This model is the GGUF f16 (full-precision float16) variant of the gemma-300m-electrical-electronics-ir family, fine-tuned from unsloth/embeddinggemma-300m for dense Information Retrieval (IR) in the electrical and electronics engineering domain. This is the highest-accuracy GGUF build — no quantization loss — designed for llama.cpp-based inference where maximum fidelity is required.

The GGUF format dramatically reduces memory requirements compared to the fp16 .safetensors variant (~612 MB vs ~1.2 GB) and enables accelerated inference on CPU and GPU via llama.cpp.

Training Data

The model was trained on the disham993/ElectricalElectronicsIR dataset — 20,000 question-passage pairs covering electrical engineering, electronics, power systems, and communications.

  • 16k train / 2k validation / 2k test
  • Queries: 133–822 characters; passages: 586–5,590 characters
  • Topics include phased array antennas, IEC 61850 protocols, Josephson junctions, OTDR measurements, MIMO channel estimation, FPGA partial reconfiguration, and more

Model Details

Base Modelunsloth/embeddinggemma-300m (308M params)
FormatGGUF f16 (full-precision float16)
TaskFeature Extraction (Dense IR / Semantic Search)
LanguageEnglish (en)
Datasetdisham993/ElectricalElectronicsIR
Approx. size~612 MB
Backendllama.cpp / llama-cpp-python
LicenseMIT

Training Procedure

Training Hyperparameters

MethodLoRA via Unsloth's FastSentenceTransformer, exported to GGUF f16
LoRA rank / alphar=32, α=64
Target modulesq_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj
LossMultipleNegativesRankingLoss (in-batch negatives)
Batch size128 per device × 2 gradient accumulation = 256 effective
Learning rate2e-5 (linear schedule, 3% warmup)
Max steps100
Max sequence length1024
Precisionbf16 (training) → f16 GGUF (export)
Batch samplerNO_DUPLICATES
HardwareNVIDIA RTX 5090

Evaluation Results

Evaluated on the held-out test split (2,000 queries) of disham993/ElectricalElectronicsIR using sentence_transformers.evaluation.InformationRetrievalEvaluator.

ModelMAP@100NDCG@10MRR@10Recall@10
unsloth/embeddinggemma-300m (baseline)0.57530.62210.56820.7925
electrical-embeddinggemma-ir_lora0.97950.98470.97951.0000
electrical-embeddinggemma-ir_finetune_16bit0.97970.98490.97971.0000
electrical-embeddinggemma-ir_f16 (this model)0.98490.98870.98490.9995
electrical-embeddinggemma-ir_q8_00.98440.98830.98440.9995
electrical-embeddinggemma-ir_q4_k_m0.98410.98790.98400.9990
electrical-embeddinggemma-ir_q5_k_m0.98240.98660.98230.9990

Highest MAP@100 (0.9849) across all variants — the reference ceiling for this model family.

Usage

LM Studio (OpenAI-compatible API)

Load this model in LM Studio and use it via the built-in OpenAI-compatible server:

from openai import OpenAI

client = OpenAI(base_url="http://127.0.0.1:1234/v1", api_key="lm-studio")

texts = [
    "What is impedance matching?",
    "Impedance matching maximises power transfer by equalising source and load impedance.",
    "An LLC resonant converter achieves zero-voltage switching using an LC tank circuit.",
]

response = client.embeddings.create(
    model="text-embedding-electrical-embeddinggemma-ir",
    input=texts,
)

for item in response.data:
    print(f"[{item.index}] dim={len(item.embedding)}  first5={item.embedding[:5]}")

llama-cpp-python

# Install dependencies
pip install huggingface_hub
CMAKE_ARGS="-DGGML_CUDA=on" FORCE_CMAKE=1 pip install llama-cpp-python # (For NVIDIA GPU acceleration)
import torch
import torch.nn.functional as F
from huggingface_hub import hf_hub_download, HfApi
from llama_cpp import Llama

class DummyModelCardData:
    def set_evaluation_metrics(self, *args, **kwargs): pass

class GGUFEmbeddingWrapper:
    def __init__(self, repo_id):
        self.repo_id = repo_id
        # Automatically detect the GGUF file in the repo
        api = HfApi()
        files = api.list_repo_files(repo_id)
        gguf_file = next((f for f in files if f.endswith('.gguf')), None)
        if not gguf_file: raise ValueError(f"No .gguf file found in disham993/electrical-electronics-gemma-ir_f16")
        
        print(f"Downloading/Using {gguf_file} from disham993/electrical-electronics-gemma-ir_f16...")
        model_path = hf_hub_download(repo_id=repo_id, filename=gguf_file)
        
        self.llm = Llama(
            model_path=model_path,
            embedding=True,       # CRITICAL: Required for dense extraction
            n_gpu_layers=-1,      # Offload completely to GPU (Optional)
            n_ctx=1024,           # Constrain context window
            verbose=False
        )
        self.dtype = torch.float16
        self.model_card_data = DummyModelCardData() # Bypasses evaluator metadata crashes
        
    def encode(self, sentences, batch_size=None, **kwargs):
        convert_to_tensor = kwargs.pop('convert_to_tensor', True)
        if isinstance(sentences, str): sentences = [sentences]
            
        # Handling list of dicts for corpus evaluations
        if isinstance(sentences, list) and len(sentences) > 0 and isinstance(sentences[0], dict):
            sentences = [(doc.get("title", "") + " " + doc.get("text", "")).strip() for doc in sentences]
            
        embeddings = []
        for text in sentences:
            res = self.llm.create_embedding(text)
            embeddings.append(res['data'][0]['embedding'])
            
        tensors = torch.tensor(embeddings, dtype=torch.float32)
        if convert_to_tensor:
            if torch.cuda.is_available(): tensors = tensors.cuda()
            return tensors
        return tensors.cpu().numpy()

    # Dynamic alias interceptor to satisfy strict evaluator engines
    def __getattr__(self, name):
        if name.startswith("encode_"):
            def wrapper(*args, **kwargs):
                kwargs['convert_to_tensor'] = True
                return self.encode(*args, **kwargs)
            return wrapper
        raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'")


# === SEMANTIC SEARCH EXAMPLE ===
if __name__ == "__main__":
    # Boot the wrapper dynamically against this Hub Repo
    model = GGUFEmbeddingWrapper("disham993/electrical-electronics-gemma-ir_q8_0")
    
    query = "How do transformers step up voltage?"
    
    # A miniature corpus of 10 engineering documents
    documents = [
        "Ohm's law defines the relationship between voltage, current, and resistance.",
        "AC circuits use alternating current which changes direction periodically.",
        "A step-up transformer has more turns on its secondary coil than its primary, increasing voltage.",
        "Capacitors store electrical energy in an electric field.",
        "Inductors resist changes in electric current passing through them.",
        "Transformers operate on Faraday's law of induction to transfer energy between circuits.",
        "Diodes allow current to pass in only one direction.",
        "Voltage is the electric potential difference between two points.",
        "A step-down transformer decreases voltage for safe residential use.",
        "Power is the rate at which electrical energy is transferred by a circuit."
    ]
    
    print("Embedding query and documents...")
    query_emb = model.encode(query)
    doc_embs = model.encode(documents)
    
    similarities = F.cosine_similarity(query_emb, doc_embs)
    top_3_idx = torch.topk(similarities, k=3).indices.tolist()
    
    print(f"\n--- Top 3 Documents for Query: '{query}' ---")
    for rank, idx in enumerate(top_3_idx, 1):
        print(f"Rank {rank} (Score: {similarities[idx]:.4f}) | {documents[idx]}")

Limitations and Bias

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:

  • Underperform on queries that mix electrical engineering with unrelated domains (e.g., biomedical, legal, financial)
  • Show reduced performance on non-English text or highly colloquial phrasing
  • Require llama-cpp-python with CUDA support for GPU-accelerated inference; CPU inference is supported but slower

This model is intended for research, educational, and production IR applications in the electrical engineering domain.

Training Infrastructure

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.

Last Update

2026-04-18

Citation

@misc{electrical-embeddinggemma-ir,
  author       = {disham993},
  title        = {Electrical \& Electronics Engineering Embedding Models},
  year         = {2026},
  howpublished = {\url{https://huggingface.co/collections/disham993/electrical-and-electronics-engineering-embedding-models}},
}

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм

Нельзя запустить

GGUF-веса поддерживаются только для текстовых LLM (llama.cpp).

Класс архитектуры
Gemma3TextModel
Ревизия весов
56aa403

0 моделей