moelanoby / Qwen2-1.5B-wina

huggingface.co
Total runs: 3
24-hour runs: 0
7-day runs: 0
30-day runs: 2
Model's Last Updated: June 10 2025
text-generation

Introduction of Qwen2-1.5B-wina

Model Details of Qwen2-1.5B-wina

use the following script to load the model

import torch
from transformers import AutoModelForCausalLM, AutoTokenizer

# --- Critical: Import the custom functions needed to build the model ---
from wina_utils import apply_wina_to_model

# --- Configuration ---
# The path to your locally saved model, or its ID on the Hugging Face Hub
MODEL_PATH = "moelanoby/Qwen2-1.5B-wina"
# Example after upload: 
SPARSITY_LEVEL = 0.65 # THIS MUST STAY 0.65 OR 65% ANYTHING ELSE MIGHT CAUSE ERRORS

def load_custom_wina_model(model_path: str, sparsity: float):
    """
    Loads a custom WINA-modified model correctly.
    """
    print(f"Loading WINA model from: {model_path}")

    # --- Step 1: Load the tokenizer ---
    # trust_remote_code=True is needed here because the model folder contains wina_utils.py
    tokenizer = AutoTokenizer.from_pretrained(model_path, trust_remote_code=True)

    # --- Step 2: Load the BASE model architecture ---
    # We load the original model structure first. It will have the standard MLP layers.
    # trust_remote_code=True allows it to execute the original model's code if needed.
    print("Loading the base model architecture...")
    model = AutoModelForCausalLM.from_pretrained(
        model_path,
        torch_dtype=torch.float16,
        device_map="auto",
        trust_remote_code=True
    )

    # --- Step 3: Manually apply the WINA transformation to the architecture ---
    # This swaps the standard MLP layers with our WinaMLP layers, creating the
    # correct structure in memory to receive the saved weights.
    print("Applying WINA transformation to the loaded architecture...")
    apply_wina_to_model(model, sparsity_level=sparsity)

    print("\n" + "="*50)
    print("SUCCESS: Custom WINA model loaded correctly.")
    print("="*50)
    return model, tokenizer

if __name__ == "__main__":
    wina_model, wina_tokenizer = load_custom_wina_model(MODEL_PATH, SPARSITY_LEVEL)

    # You can now use the model for inference
    print("\nVerifying model architecture (you should see 'WinaMLP' layers):")
    print(wina_model)

Runs of moelanoby Qwen2-1.5B-wina on huggingface.co

3
Total runs
0
24-hour runs
0
3-day runs
0
7-day runs
2
30-day runs

More Information About Qwen2-1.5B-wina huggingface.co Model

More Qwen2-1.5B-wina license Visit here:

https://choosealicense.com/licenses/apache-2.0

Qwen2-1.5B-wina huggingface.co

Qwen2-1.5B-wina huggingface.co is an AI model on huggingface.co that provides Qwen2-1.5B-wina's model effect (), which can be used instantly with this moelanoby Qwen2-1.5B-wina model. huggingface.co supports a free trial of the Qwen2-1.5B-wina model, and also provides paid use of the Qwen2-1.5B-wina. Support call Qwen2-1.5B-wina model through api, including Node.js, Python, http.

Qwen2-1.5B-wina huggingface.co Url

https://huggingface.co/moelanoby/Qwen2-1.5B-wina

moelanoby Qwen2-1.5B-wina online free

Qwen2-1.5B-wina huggingface.co is an online trial and call api platform, which integrates Qwen2-1.5B-wina's modeling effects, including api services, and provides a free online trial of Qwen2-1.5B-wina, you can try Qwen2-1.5B-wina online for free by clicking the link below.

moelanoby Qwen2-1.5B-wina online free url in huggingface.co:

https://huggingface.co/moelanoby/Qwen2-1.5B-wina

Qwen2-1.5B-wina install

Qwen2-1.5B-wina is an open source model from GitHub that offers a free installation service, and any user can find Qwen2-1.5B-wina on GitHub to install. At the same time, huggingface.co provides the effect of Qwen2-1.5B-wina install, users can directly use Qwen2-1.5B-wina installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

Qwen2-1.5B-wina install url in huggingface.co:

https://huggingface.co/moelanoby/Qwen2-1.5B-wina

Url of Qwen2-1.5B-wina

Qwen2-1.5B-wina huggingface.co Url

Provider of Qwen2-1.5B-wina huggingface.co

moelanoby
ORGANIZATIONS

Other API from moelanoby

huggingface.co

Total runs: 20
Run Growth: 3
Growth Rate: 15.79%
Updated:June 10 2025
huggingface.co

Total runs: 3
Run Growth: 3
Growth Rate: 100.00%
Updated:December 09 2024
huggingface.co

Total runs: 3
Run Growth: 2
Growth Rate: 66.67%
Updated:March 29 2025
huggingface.co

Total runs: 2
Run Growth: 1
Growth Rate: 50.00%
Updated:July 05 2025
huggingface.co

Total runs: 2
Run Growth: 1
Growth Rate: 50.00%
Updated:March 27 2025
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:March 12 2025
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:June 29 2025
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:August 05 2024