AXCXEPT/EZO-AutoCoTRAG-Qwen2.5-32B-Instruct

image/png

Introduction

This model is based on โ€œhttps://huggingface.co/AXCXEPT/EZO-Qwen2.5-32B-Instructโ€ and automatically performs โ€œChain-Of-Thoughtโ€ and โ€œRAGโ€ as custom processing to compensate for knowledge that LLM itself does not have This is an LLM with additional custom processing. Base model: โ€œAXCXEPT/EZO-Qwen2.5-32B-Instructโ€ is based on Qwen/Qwen2.5-32B-Instruct with multiple tunings to improve overall performance from the Base model.

ใ“ใฎใƒขใƒ‡ใƒซใฏใ€ใ€Œ https://huggingface.co/AXCXEPT/EZO-Qwen2.5-32B-Instruct ใ€ ใ‚’ใƒ™ใƒผใ‚นใจใ—ใฆใ€ใ‚ซใ‚นใ‚ฟใƒ ๅ‡ฆ็†ใจใ—ใฆใ€ŒChain-Of-Thoughtใ€ใจใ€ŒRAGใ€ใ‚’่‡ชๅ‹•ใง่กŒใ„ใ€LLM่‡ช่บซใŒๆŒใฃใฆใ„ใชใ„็Ÿฅ่ญ˜ใ‚’่ฃœใ†ใ‚ซใ‚นใ‚ฟใƒ ใฎๅ‡ฆ็†ใ‚’่ฟฝๅŠ ใ—ใŸLLMใงใ™ใ€‚ ใƒ™ใƒผใ‚นใจใชใ‚‹ใƒขใƒ‡ใƒซ๏ผšใ€ŒAXCXEPT/EZO-Qwen2.5-32B-Instructใ€ใฏใ€Qwen/Qwen2.5-32B-Instructใ‚’ใƒ™ใƒผใ‚นใซ่ค‡ๆ•ฐใฎใƒใƒฅใƒผใƒ‹ใƒณใ‚ฐใ‚’ๆ–ฝใ—ใ€Baseใƒขใƒ‡ใƒซใ‹ใ‚‰็ทๅˆ็š„ใชใƒ‘ใƒ•ใ‚ฉใƒผใƒžใƒณใ‚นใ‚’ๅ‘ไธŠใ•ใ›ใŸใƒขใƒ‡ใƒซใงใ™ใ€‚

[Auto CoT RAG]

image/png

Auto-CoT-RAG (Automatic Chain of Thought with Real-time Augmented Generation) technology is implemented. In addition to providing a multi-faceted mechanism for internalizing Internet search results, which are often incorporated into systems, it also realizes manual chain of thought processing for internal processing. This is an LLM x program style technique. Auto-CoT (Chain of Thought): internally deepens thinking through multiple steps, allowing for more complex reasoning. Real-time Knowledge Augmentation (RAG): allows users to go beyond the limits of trained data and perform web searches in real time to incorporate the latest information.

Auto-CoT-RAG๏ผˆAutomatic Chain of Thought with Real-time Augmented Generation๏ผ‰ๆŠ€่ก“ใ‚’ๅฎŸ่ฃ…ใ—ใฆใ„ใพใ™ใ€‚ใ‚ทใ‚นใƒ†ใƒ ใจใ—ใฆ็ต„ใฟ่พผใ‚€ใ“ใจใฎๅคšใ„ใ€ใ‚คใƒณใ‚ฟใƒผใƒใƒƒใƒˆๆคœ็ดข็ตๆžœใ‚’ๅ†…ๅŒ…ใ—ๅคšไป•็ต„ใฟใ‚’ๆไพ›ใ™ใ‚‹ใปใ‹ใ€ๅ†…้ƒจๅ‡ฆ็†ใซๆ‰‹ๆ€่€ƒใฎ้€ฃ้Ž–ๅ‡ฆ็†ใ‚’ๅฎŸ็พใ—ใฆใ„ใพใ™ใ€‚ใ“ใ‚ŒใฏLLMร—ใƒ—ใƒญใ‚ฐใƒฉใƒ ใจใ„ใ†ใ‚นใ‚ฟใ‚คใƒซใฎๆ‰‹ๆณ•ใงใ™ใ€‚

่‡ชๅ‹•ๆ€่€ƒ้€ฃ้Ž–๏ผˆAuto-CoT๏ผ‰๏ผšๅ†…้ƒจ็š„ใซ่ค‡ๆ•ฐใฎใ‚นใƒ†ใƒƒใƒ—ใ‚’่ธใ‚“ใงๆ€่€ƒใ‚’ๆทฑๅŒ–ใ•ใ›ใ€ใ‚ˆใ‚Š่ค‡้›‘ใชๆŽจ่ซ–ใ‚’ๅฏ่ƒฝใซใ—ใพใ™ใ€‚

ใƒชใ‚ขใƒซใ‚ฟใ‚คใƒ ็Ÿฅ่ญ˜ๆ‹กๅผต๏ผˆRAG๏ผ‰๏ผšๅญฆ็ฟ’ๆธˆใฟใƒ‡ใƒผใ‚ฟใฎ้™็•Œใ‚’่ถ…ใˆใ€ใƒชใ‚ขใƒซใ‚ฟใ‚คใƒ ใงใ‚ฆใ‚งใƒ–ๆคœ็ดขใ‚’่กŒใ„ๆœ€ๆ–ฐใฎๆƒ…ๅ ฑใ‚’ๅ–ใ‚Š่พผใ‚€ใ“ใจใŒใงใใพใ™ใ€‚

[Usage]

Here provides a code snippet with apply_chat_template to show you how to load the tokenizer and model and how to generate contents.

pip install bitsandbytes transformers accelerate duckduckgo_search
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
from modeling_custom_qwen import CustomQwen2Model

model_name = "AXCXEPT/EZO-AutoCoTRAG-Qwen2.5-32B-Instruct"

model = AutoModelForCausalLM.from_pretrained(
    model_name,
    torch_dtype=torch.bfloat16,
    device_map="auto",
    trust_remote_code=True
)
tokenizer = AutoTokenizer.from_pretrained(model_name)
model.set_tokenizer(tokenizer)

#================================================
# You can change max think count(default:=5):
model.set_max_iterations(2)
# You can change using RAG(default:=True)
model.set_use_search(True)
# You can change using RAG-top-k(default:=3)
model.set_top_k(3)
#================================================

prompt = "Who will be President of the United States in 2024?"
messages = [
    {"role": "system", "content": "You are a helpful assistant."},
    {"role": "user", "content": prompt}
]
text = tokenizer.apply_chat_template(
    messages,
    tokenize=False,
    add_generation_prompt=True
)
model_inputs = tokenizer([text], return_tensors="pt")
#if you don't use "load_in_4bit", you should do "model_inputs = tokenizer([text], return_tensors="pt").to(model.device)"

generated_ids = model.generate(
    **model_inputs,
    max_new_tokens=512
)

# decode 
full_generated_text = tokenizer.decode(generated_ids[0], skip_special_tokens=True)

# Find latest Assistant:
assistant_token = "Assistant:"
last_assistant_index = full_generated_text.rfind(assistant_token)

if last_assistant_index != -1:
    # Select last word of 'Assistant:'
    response = full_generated_text[last_assistant_index + len(assistant_token):].strip()
else:
    # If 'Assistant:' is not found, use full text
    response = full_generated_text.strip()
print(response)

[Disclaimer]

ใ“ใฎใƒขใƒ‡ใƒซใฏ็ ”็ฉถ้–‹็™บใฎใฟใ‚’็›ฎ็š„ใจใ—ใฆๆไพ›ใ•ใ‚Œใ‚‹ใ‚‚ใฎใงใ‚ใ‚Šใ€ๅฎŸ้จ“็š„ใชใƒ—ใƒญใƒˆใ‚ฟใ‚คใƒ—ใจใฟใชใ•ใ‚Œใ‚‹ในใใƒขใƒ‡ใƒซใงใ™ใ€‚ ๅ•†ๆฅญ็š„ใชไฝฟ็”จใ‚„ใƒŸใƒƒใ‚ทใƒงใƒณใ‚ฏใƒชใƒ†ใ‚ฃใ‚ซใƒซใช็’ฐๅขƒใธใฎ้…ๅ‚™ใ‚’ๆ„ๅ›ณใ—ใŸใ‚‚ใฎใงใฏใ‚ใ‚Šใพใ›ใ‚“ใ€‚ ๆœฌใƒขใƒ‡ใƒซใฎไฝฟ็”จใฏใ€ไฝฟ็”จ่€…ใฎ่ฒฌไปปใซใŠใ„ใฆ่กŒใ‚ใ‚Œใ‚‹ใ‚‚ใฎใจใ—ใ€ใใฎๆ€ง่ƒฝใŠใ‚ˆใณ็ตๆžœใฏไฟ่จผใ•ใ‚Œใพใ›ใ‚“ใ€‚ Axcxeptๆ ชๅผไผš็คพใฏใ€็›ดๆŽฅ็š„ใ€้–“ๆŽฅ็š„ใ€็‰นๅˆฅใ€ๅถ็™บ็š„ใ€็ตๆžœ็š„ใชๆๅฎณใ€ใพใŸใฏๆœฌใƒขใƒ‡ใƒซใฎไฝฟ็”จใ‹ใ‚‰็”Ÿใ˜ใ‚‹ใ„ใ‹ใชใ‚‹ๆๅคฑใซๅฏพใ—ใฆใ‚‚ใ€ๅพ—ใ‚‰ใ‚ŒใŸ็ตๆžœใซใ‹ใ‹ใ‚ใ‚‰ใšใ€ไธ€ๅˆ‡ใฎ่ฒฌไปปใ‚’่ฒ ใ„ใพใ›ใ‚“ใ€‚ ๅˆฉ็”จ่€…ใฏใ€ๆœฌใƒขใƒ‡ใƒซใฎไฝฟ็”จใซไผดใ†ใƒชใ‚นใ‚ฏใ‚’ๅๅˆ†ใซ็†่งฃใ—ใ€่‡ชๅทฑใฎๅˆคๆ–ญใงไฝฟ็”จใ™ใ‚‹ใ‚‚ใฎใจใ—ใพใ™ใ€‚

[่ฌ่พž/thanks]

We would like to express our gratitude and respect to Alibaba Cloud and the team of developers who developed this base model, as well as to the many others who contributed to the automated evaluation methodology. ๆœฌใƒ™ใƒผใ‚นใƒขใƒ‡ใƒซใ‚’้–‹็™บใ—ใฆใใ ใ•ใฃใŸAlibaba Cloud็คพใชใ‚‰ใณใซๅฝ“่ฉฒใƒใƒผใƒ ใฎ้–‹็™บ่€…ใฎๆ–นใ€…ใ€ใพใŸ่‡ชๅ‹•่ฉ•ไพกใฎๆ‰‹ๆณ•ใ‚’ๆไพ›ใ—ใฆใใ ใ•ใฃใŸๅคšๆ•ฐใฎๆ–นใ€…ใซๆ„Ÿ่ฌใจๅฐŠๆ•ฌใฎๆ„ใ‚’่กจใ—ใพใ™ใ€‚

Company:

Axcxept co., ltd. Axcxept logo

Downloads last month
17
Safetensors
Model size
33B params
Tensor type
BF16
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for AXCXEPT/EZO-AutoCoTRAG-Qwen2.5-32B-Instruct

Base model

Qwen/Qwen2.5-32B
Finetuned
(1)
this model
Merges
1 model

Collections including AXCXEPT/EZO-AutoCoTRAG-Qwen2.5-32B-Instruct