hf_mirrors/YI-1.5-34B
Model Introduction
Files & versions
Analysis

🐙 GitHub • 👾 Discord • 🐤 Twitter • 💬 WeChat
📝 Paper • 💪 Tech Blog • 🙌 FAQ • 📗 Learning Hub

Intro

Yi-1.5 is an upgraded version of Yi. It is continuously pre-trained on Yi with a high-quality corpus of 500B tokens and fine-tuned on 3M diverse fine-tuning samples.

Compared with Yi, Yi-1.5 delivers stronger performance in coding, math, reasoning, and instruction-following capability, while still maintaining excellent capabilities in language understanding, commonsense reasoning, and reading comprehension.

ModelContext LengthPre-trained Tokens
Yi-1.54K, 16K, 32K3.6T

openmind 推理脚本



import argparse
import torch
from openmind import pipeline, is_torch_npu_available
from openmind import AutoTokenizer, AutoModelForCausalLM
def parse_args():
    parser = argparse.ArgumentParser()
    parser.add_argument(
        "--model_name_or_path",
        type=str,
        help="Path to model",
        default=None,
    )
    args = parser.parse_args()
    return args
if is_torch_npu_available():
    device = "npu:0"
else:
    device = "cpu"

model_path = 'Rose/YI-1.5-34B'

tokenizer = AutoTokenizer.from_pretrained(model_path, trust_remote_code=True)

model = AutoModelForCausalLM.from_pretrained(
    model_path,
    trust_remote_code=True,
    torch_dtype=torch.float16, 
    device_map="auto"
)

prompt = "请帮我生成一段关于中国历史的介绍,请详细介绍中国的古代,近代历史"

inputs = tokenizer(prompt, return_tensors="pt")
inputs = inputs.to(model.device)

outputs = model.generate(
    **inputs,
    max_length=2048,
    num_return_sequences=1,
    temperature=0.7,
    top_p=0.6,
    top_k=20,
    repetition_penalty=1.2,
    do_sample=True,
    pad_token_id=tokenizer.pad_token_id
)

response = tokenizer.decode(outputs[0], skip_special_tokens=True)

print("输入:", prompt)
print("输出:", response)

Models

  • Chat models

    NameDownload
    Yi-1.5-34B-Chat• 🤗 Hugging Face • 🤖 ModelScope • 🟣 wisemodel
    Yi-1.5-34B-Chat-16K• 🤗 Hugging Face • 🤖 ModelScope • 🟣 wisemodel
    Yi-1.5-9B-Chat• 🤗 Hugging Face • 🤖 ModelScope • 🟣 wisemodel
    Yi-1.5-9B-Chat-16K• 🤗 Hugging Face • 🤖 ModelScope • 🟣 wisemodel
    Yi-1.5-6B-Chat• 🤗 Hugging Face • 🤖 ModelScope • 🟣 wisemodel
  • Base models

    NameDownload
    Yi-1.5-34B• 🤗 Hugging Face • 🤖 ModelScope • 🟣 wisemodel
    Yi-1.5-34B-32K• 🤗 Hugging Face • 🤖 ModelScope • 🟣 wisemodel
    Yi-1.5-9B• 🤗 Hugging Face • 🤖 ModelScope • 🟣 wisemodel
    Yi-1.5-9B-32K• 🤗 Hugging Face • 🤖 ModelScope • 🟣 wisemodel
    Yi-1.5-6B• 🤗 Hugging Face • 🤖 ModelScope • 🟣 wisemodel

Benchmarks

  • Chat models

    Yi-1.5-34B-Chat is on par with or excels beyond larger models in most benchmarks.

    image/png

    Yi-1.5-9B-Chat is the top performer among similarly sized open-source models.

    image/png

  • Base models

    Yi-1.5-34B is on par with or excels beyond larger models in some benchmarks.

    image/png

    Yi-1.5-9B is the top performer among similarly sized open-source models.

    image/png

Quick Start

For getting up and running with Yi-1.5 models quickly, see README.