hf_mirrors/Faro-Yi-9B
Model Introduction
Files & versions
Analysis

The Faro chat model focuses on practicality and long-context modeling. It handles various downstream tasks with higher quality, delivering stable and reliable results even when inputs contain lengthy documents or complex instructions. Faro seamlessly works in both English and Chinese.

Faro-Yi-9B

Faro-Yi-9B is an improved Yi-9B-200K with extensive instruction tuning on Fusang-V1. Compared to Yi-9B-200K, Faro-Yi-9B has gained greater capability in various downstream tasks and long-context modeling thanks to the large-scale synthetic data in Fusang-V1.

Just like Yi-9B-200K, Faro-Yi-9B supports up to 200K context length.

Use with openMind

Faro-Yi-9B uses the chatml template and performs well in both short and long contexts.

environment variable

# source environment variable
source /usr/local/Ascend/ascend-toolkit/set_env.sh
export OPENMIND_FRAMEWORK=pt

Inference

from openmind import AutoModelForCausalLM, AutoTokenizer
from openmind_hub import snapshot_download
import argparse

def parse_args():
    parser = argparse.ArgumentParser()
    parser.add_argument(
        "--model_name_or_path",
        type=str,
        help="Jinan_AICC/Faro-Yi-9B",
        default=None,
    )
    args = parser.parse_args()
    return args

args = parse_args()
model_path = args.model_name_or_path
model = AutoModelForCausalLM.from_pretrained(model_path, device_map="auto")
tokenizer = AutoTokenizer.from_pretrained(model_path)
messages = [
    {"role": "system", "content": "You are a helpful assistant. Always answer with a short response."},
    {"role": "user", "content": "Tell me what is Pythagorean theorem like you are a pirate."}
]

input_ids = tokenizer.apply_chat_template(messages, tokenize=True, add_generation_prompt=True, return_tensors="pt").to(model.device)
generated_ids = model.generate(input_ids, max_new_tokens=512, temperature=0.5)
response = tokenizer.decode(generated_ids[0], skip_special_tokens=True) # Aye, matey! The Pythagorean theorem is a nautical rule that helps us find the length of the third side of a triangle. ...
print(response)

Performance

Faro-Yi-9B enhances its ability compared to Yi-9B-200K in most dimensions, especially in long-range modeling and bilingual (English, Chinese) understanding. Faro is competitive among all open-sourced models at around 9B parameters.

Benchmark Results

Fact-based Evaluation (Open LLM Leaderboard)

MetricMMLUGSM8KHellaSwagTruthfulQAArcWinogrande
Yi-9B-200K65.7350.4956.7233.8069.2571.67
Faro-Yi-9B68.8063.0857.2840.8672.5871.11

Long-context Modeling (LongBench)

NameAverage_zhAverage_enCode Completion
Yi-9B-200K30.28836.707172.2
Faro-Yi-9B41.09240.953646.0
Score breakdown
NameFew-shot Learning_enSynthetic Tasks_enSingle-Doc QA_enMulti-Doc QA_enSummarization_enFew-shot Learning_zhSynthetic Tasks_zhSingle-Doc QA_zhMulti-Doc QA_zhSummarization_zh
Yi-9B-200K60.622.830.938.925.846.528.049.617.79.7
Faro-Yi-9B63.840.236.238.026.330.075.155.630.714.1

Bilingual Ability (CMMLU & MMLU)

NameMMLUCMMLU
Yi-9B-200K65.7371.97
Faro-Yi-9B68.8073.28