hf_mirrors/T3Q_SOLAR_SLERP_v1.0-openmind
Model Introduction
Files & versions
Analysis

Untitled Model (1)

This is a merge of pre-trained language models created using mergekit.

Use in Openmind

import torch
from openmind import AutoTokenizer, AutoModelForCausalLM, is_torch_npu_available
from openmind_hub import snapshot_download
import argparse
import time

def parse_args():
    parser = argparse.ArgumentParser()
    parser.add_argument(
        "--model_name_or_path",
        type=str,
        help="Path to model",
        default="jeffding/T3Q_SOLAR_SLERP_v1.0-openmind",
    )
    args = parser.parse_args()
    return args

def main():
    args = parse_args()
    model_path = args.model_name_or_path

    if is_torch_npu_available():
        device = "npu:0"
    else:
        device = "cpu"
        
    tokenizer = AutoTokenizer.from_pretrained(model_path, trust_remote_code=True)
    # Set `torch_dtype=torch.float16` to load model in float16, otherwise it will be loaded as float32 and might cause OOM Error.
    model = AutoModelForCausalLM.from_pretrained(model_path, torch_dtype=torch.float16, trust_remote_code=True).to(device)
    
    start_time = time.time()
    
    model = model.eval()
    inputs = tokenizer(["상해라는 도시를 간단히 소개하겠습니다."], return_tensors="pt")
    for k,v in inputs.items():
        inputs[k] = v.to(device)
    gen_kwargs = {"max_length": 500, "top_p": 0.8, "temperature": 0.8, "do_sample": True, "repetition_penalty": 1.0}
    output = model.generate(**inputs, **gen_kwargs)
    output = tokenizer.decode(output[0].tolist(), skip_special_tokens=True)
    print(output)
    
    end_time = time.time()
    print(f"硬件环境:{device},推理执行时间:{end_time - start_time}秒")

if __name__ == "__main__":
    main()

Merge Details

Merge Method

This model was merged using the SLERP merge method.

Models Merged

The following models were included in the merge:

  • chihoonlee10/T3Q-ko-solar-dpo-v7.0
  • hwkwon/S-SOLAR-10.7B-v1.5

Configuration

The following YAML configuration was used to produce this model:

slices:
  - sources:
      - model: chihoonlee10/T3Q-ko-solar-dpo-v7.0
        layer_range: [0, 48]
      - model: hwkwon/S-SOLAR-10.7B-v1.5
        layer_range: [0, 48]
# or, the equivalent models: syntax:
# models:
#   - model: psmathur/orca_mini_v3_13b
#   - model: garage-bAInd/Platypus2-13B
merge_method: slerp
base_model: chihoonlee10/T3Q-ko-solar-dpo-v7.0
parameters:
  t:
    - filter: self_attn
      value: [0, 0.5, 0.3, 0.7, 1]
    - filter: mlp
      value: [1, 0.5, 0.7, 0.3, 0]
    - value: 0.5 # fallback for rest of tensors
dtype: float16