Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Implementation:666ghj BettaFish QWEN3 MODELS config

From Leeroopedia
Knowledge Sources
Domains Configuration, Deep_Learning
Last Updated 2026-10-08 00:00 GMT

Overview

Concrete configuration module defining Qwen3 model parameters (base model, embedding dimension, LoRA rank/alpha, recommended hyperparameters) and file paths for three model sizes.

Description

The QWEN3_MODELS and MODEL_PATHS dictionaries provide a declarative configuration for Qwen3 sentiment models. `QWEN3_MODELS` maps model sizes ("0.6B", "4B", "8B") to their configuration: base_model HuggingFace ID, embedding model ID, embedding dimension, max sequence length, recommended batch size, learning rate, and LoRA rank/alpha. `MODEL_PATHS` maps model types ("embedding", "lora") and sizes to file paths for saved models.

Usage

Import these constants when you need to look up Qwen3 model configuration. They are used by `Qwen3LoRAUniversal` and `Qwen3UniversalPredictor`.

Code Reference

Source Location

  • Repository: BettaFish
  • File: `SentimentAnalysisModel/WeiboSentiment_SmallQwen/models_config.py:L1-53`

Signature

QWEN3_MODELS = {
    "0.6B": {
        "base_model": "Qwen/Qwen3-0.6B",
        "embedding_model": "Qwen/Qwen3-Embedding-0.6B",
        "embedding_dim": 1024,
        "max_length": 32768,
        "recommended_batch_size": 32,
        "recommended_lr": 1e-3,
        "lora_r": 16,
        "lora_alpha": 32,
    },
    "4B": {
        "base_model": "Qwen/Qwen3-4B",
        "embedding_model": "Qwen/Qwen3-Embedding-4B",
        "embedding_dim": 2560,
        "max_length": 32768,
        "recommended_batch_size": 16,
        "recommended_lr": 5e-4,
        "lora_r": 32,
        "lora_alpha": 64,
    },
    "8B": {
        "base_model": "Qwen/Qwen3-8B",
        "embedding_model": "Qwen/Qwen3-Embedding-8B",
        "embedding_dim": 4096,
        "max_length": 32768,
        "recommended_batch_size": 8,
        "recommended_lr": 2e-4,
        "lora_r": 64,
        "lora_alpha": 128,
    },
}

MODEL_PATHS = {
    "embedding": {"0.6B": "./models/qwen3_embedding_0.6b_sentiment.pth", ...},
    "lora": {"0.6B": "./models/qwen3_lora_0.6b_final", ...},
}

Import

from SentimentAnalysisModel.WeiboSentiment_SmallQwen.models_config import QWEN3_MODELS, MODEL_PATHS

I/O Contract

This is a configuration module (Pattern Doc) — no runtime I/O. It provides static dictionaries for model configuration lookup.

Usage Examples

Look Up Model Config

from SentimentAnalysisModel.WeiboSentiment_SmallQwen.models_config import QWEN3_MODELS, MODEL_PATHS

config = QWEN3_MODELS["4B"]
print(f"Base model: {config['base_model']}")
print(f"LoRA rank: {config['lora_r']}, alpha: {config['lora_alpha']}")
print(f"Recommended batch size: {config['recommended_batch_size']}")

path = MODEL_PATHS["lora"]["4B"]
print(f"Model path: {path}")

Related Pages

Implements Principle

Requires Environment

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment