AXCXEPT/EZO-AutoCoTRAG-Qwen2.5-32B-Instruct
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]
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:
- Downloads last month
- 17
Model tree for AXCXEPT/EZO-AutoCoTRAG-Qwen2.5-32B-Instruct
Base model
Qwen/Qwen2.5-32B

