TheBloke's LLM work is generously supported by a grant from andreessen horowitz (a16z)
Fire Balloon's Baichuan Vicuna 7B GPTQ
These files are GPTQ 4bit model files for Fire Balloon's Baichuan Vicuna 7B.
It is the result of quantising to 4bit using GPTQ-for-LLaMa.
Repositories available
- 4-bit GPTQ models for GPU inference
- 2, 3, 4, 5, 6 and 8-bit GGML models for CPU+GPU inference
- Unquantised fp16 model in pytorch format, for GPU inference and for further conversions
Prompt template: Vicuna 1.1
A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions.
USER: prompt
ASSISTANT:
How to easily download and use this model in text-generation-webui
Please make sure you're using the latest version of text-generation-webui
- Click the Model tab.
- Under Download custom model or LoRA, enter
TheBloke/baichuan-vicuna-7B-GPTQ
. - Click Download.
- The model will start downloading. Once it's finished it will say "Done"
- In the top left, click the refresh icon next to Model.
- In the Model dropdown, choose the model you just downloaded:
baichuan-vicuna-7B-GPTQ
- The model will automatically load, and is now ready for use!
- If you want any custom settings, set them and then click Save settings for this model followed by Reload the Model in the top right.
- Note that you do not need to and should not set manual GPTQ parameters any more. These are set automatically from the file
quantize_config.json
.
- Once you're ready, click the Text Generation tab and enter a prompt to get started!
How to use this GPTQ model from Python code
First make sure you have AutoGPTQ installed:
pip install auto-gptq
Then try the following example code:
from transformers import AutoTokenizer, pipeline, logging
from auto_gptq import AutoGPTQForCausalLM, BaseQuantizeConfig
import argparse
model_name_or_path = "TheBloke/baichuan-vicuna-7B-GPTQ"
model_basename = "baichuan-vicuna-7b-GPTQ-4bit-128g.no-act.order"
use_triton = False
tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, use_fast=True)
model = AutoGPTQForCausalLM.from_quantized(model_name_or_path,
model_basename=model_basename,
use_safetensors=True,
trust_remote_code=False,
device="cuda:0",
use_triton=use_triton,
quantize_config=None)
# Note: check the prompt template is correct for this model.
prompt = "Tell me about AI"
prompt_template=f'''USER: {prompt}
ASSISTANT:'''
print("\n\n*** Generate:")
input_ids = tokenizer(prompt_template, return_tensors='pt').input_ids.cuda()
output = model.generate(inputs=input_ids, temperature=0.7, max_new_tokens=512)
print(tokenizer.decode(output[0]))
# Inference can also be done using transformers' pipeline
# Prevent printing spurious transformers error when using pipeline with AutoGPTQ
logging.set_verbosity(logging.CRITICAL)
print("*** Pipeline:")
pipe = pipeline(
"text-generation",
model=model,
tokenizer=tokenizer,
max_new_tokens=512,
temperature=0.7,
top_p=0.95,
repetition_penalty=1.15
)
print(pipe(prompt_template)[0]['generated_text'])
Provided files
baichuan-vicuna-7b-GPTQ-4bit-128g.no-act.order.safetensors
This will work with AutoGPTQ, ExLlama, and CUDA versions of GPTQ-for-LLaMa. There are reports of issues with Triton mode of recent GPTQ-for-LLaMa. If you have issues, please use AutoGPTQ instead.
It was created with group_size 128 to increase inference accuracy, but without --act-order (desc_act) to increase compatibility and improve inference speed.
baichuan-vicuna-7b-GPTQ-4bit-128g.no-act.order.safetensors
- Works with AutoGPTQ in CUDA or Triton modes.
- LLaMa models also work with [ExLlama](https://github.com/turboderp/exllama}, which usually provides much higher performance, and uses less VRAM, than AutoGPTQ.
- Works with GPTQ-for-LLaMa in CUDA mode. May have issues with GPTQ-for-LLaMa Triton mode.
- Works with text-generation-webui, including one-click-installers.
- Parameters: Groupsize = 128. Act Order / desc_act = False.
Discord
For further support, and discussions on these models and AI in general, join us at:
Thanks, and how to contribute.
Thanks to the chirper.ai team!
I've had a lot of people ask if they can contribute. I enjoy providing models and helping people, and would love to be able to spend even more time doing it, as well as expanding into new projects like fine tuning/training.
If you're able and willing to contribute it will be most gratefully received and will help me to keep providing more models, and to start work on new AI projects.
Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
- Patreon: https://patreon.com/TheBlokeAI
- Ko-Fi: https://ko-fi.com/TheBlokeAI
Special thanks to: Aemon Algiz.
Patreon special mentions: Sam, theTransient, Jonathan Leane, Steven Wood, webtim, Johann-Peter Hartmann, Geoffrey Montalvo, Gabriel Tamborski, Willem Michiel, John Villwock, Derek Yates, Mesiah Bishop, Eugene Pentland, Pieter, Chadd, Stephen Murray, Daniel P. Andersen, terasurfer, Brandon Frisco, Thomas Belote, Sid, Nathan LeClaire, Magnesian, Alps Aficionado, Stanislav Ovsiannikov, Alex, Joseph William Delisle, Nikolai Manek, Michael Davis, Junyu Yang, K, J, Spencer Kim, Stefan Sabev, Olusegun Samson, transmissions 11, Michael Levine, Cory Kujawski, Rainer Wilmers, zynix, Kalila, Luke @flexchar, Ajan Kanaga, Mandus, vamX, Ai Maven, Mano Prime, Matthew Berman, subjectnull, Vitor Caleffi, Clay Pascal, biorpg, alfie_i, 阿明, Jeffrey Morgan, ya boyyy, Raymond Fosdick, knownsqashed, Olakabola, Leonard Tan, ReadyPlayerEmma, Enrico Ros, Dave, Talal Aujan, Illia Dulskyi, Sean Connelly, senxiiz, Artur Olbinski, Elle, Raven Klaugh, Fen Risland, Deep Realms, Imad Khwaja, Fred von Graf, Will Dee, usrbinkat, SuperWojo, Alexandros Triantafyllidis, Swaroop Kallakuri, Dan Guido, John Detwiler, Pedro Madruga, Iucharbius, Viktor Bowallius, Asp the Wyvern, Edmond Seymore, Trenton Dambrowitz, Space Cruiser, Spiking Neurons AB, Pyrater, LangChain4j, Tony Hughes, Kacper Wikieł, Rishabh Srivastava, David Ziegler, Luke Pendergrass, Andrey, Gabriel Puliatti, Lone Striker, Sebastain Graf, Pierre Kircher, Randy H, NimbleBox.ai, Vadim, danny, Deo Leter
Thank you to all my generous patrons and donaters!
And thank you again to a16z for their generous grant.
Original model card: Fire Balloon's Baichuan Vicuna 7B
baichuan-vicuna-7b
baichuan-vicuna-7b is a chat model supervised finetuned on vicuna sharegpt data.
- The foundation model is baichuan-7B, which is a large-scale pre-training model developed by Baichuan Intelligence allowing for commercial purposes.
- The finetuning data includes ShareGPT, mixed with COT and Leetcode, which are aimed to improve the model's reasoning and coding ability (the data mixing strategy is inspired by TULU).
- The training code: https://huggingface.co/fireballoon/baichuan-vicuna-7b/blob/main/train_vicuna.py, which is based on FastChat.
[New] baichuan-vicuna-chinese-7b, baichuan finetuned on both English and Chinese ShareGPT.
Load model
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("fireballoon/baichuan-vicuna-7b", use_fast=False)
model = AutoModelForCausalLM.from_pretrained("fireballoon/baichuan-vicuna-7b")
Inference
Inference with FastChat:
python3 -m fastchat.serve.cli --model-path fireballoon/baichuan-vicuna-7b
Inference with Transformers:
>>> from transformers import AutoTokenizer, AutoModelForCausalLM, TextStreamer
>>> tokenizer = AutoTokenizer.from_pretrained("fireballoon/baichuan-vicuna-7b", use_fast=False)
>>> model = AutoModelForCausalLM.from_pretrained("fireballoon/baichuan-vicuna-7b").half().cuda()
>>> streamer = TextStreamer(tokenizer, skip_prompt=True, skip_special_tokens=True)
>>> instruction = "A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions. USER: {} ASSISTANT:"
>>> prompt = instruction.format("five tips to help with sleep") # user message
>>> generate_ids = model.generate(tokenizer(prompt, return_tensors='pt').input_ids.cuda(), max_new_tokens=2048, streamer=streamer)
'''
1. Create a relaxing bedtime routine, such as winding down with a warm bath or reading a book before bed.
2. Avoid caffeine and alcohol close to bedtime, as they can disrupt sleep.
3. Use blackout curtains or shades to block out light from the outside, which can interfere with your body's natural sleep rhythms.
4. Keep your bedroom cool and dark, and avoid using electronic devices at least an hour before bed.
5. Regular exercise and a healthy diet can also help improve sleep quality.
'''
Test examples on FastChat Eval
Test example on FastChat Eval
Please refer to discussions 2 for comparative evaluation of Baichuan-vicuna-7b and Vicuna-13b by GPT-4.
Q: How can I improve my time management skills?
A: There are many different ways to improve your time management skills. Here are a few strategies that you may find helpful:
1 Prioritize your tasks: Make a list of all the tasks you need to complete and prioritize them based on importance and urgency. This will help you focus on the most important tasks and avoid getting bogged down by less critical items.
2 Use a time management planner: A planner can help you organize your time by breaking down your tasks into smaller, more manageable chunks. This can help you stay focused and on track.
3 Set clear boundaries: Setting clear boundaries between work time and personal time can help you avoid distractions and stay focused on your tasks. This may involve designating certain times of day or days of the week for work and other times for rest and leisure.
4 Take care of your physical and mental health: Taking care of your physical and mental health can help you be more productive and focused. This may involve getting enough sleep, eating a healthy diet, and taking breaks to relax and recharge.
Remember that improving your time management skills takes practice and patience. Don't be discouraged if you make mistakes or experience setbacks. Keep trying and you will eventually develop better time management habits that will help you be more productive and successful.
Q: Can you help me write a formal email to a potential business partner proposing a joint venture?
A: Sure! Here is a sample formal email that you could use as a template to propose a joint venture with a
potential business partner:
Subject: Proposal for Joint Venture
Dear [Business Partner],
I hope this email finds you well. I am writing to propose a joint venture between our companies. We believe that a collaboration between our companies could bring significant benefits to both of us, and we would like to explore the possibility of forming a partnership.
Our companies have complementary strengths, and we believe that a joint venture could allow us to leverage those strengths to create new products, services, and opportunities. We believe that a joint venture could also provide increased revenue and growth for both of our companies.
In order to explore the possibility of a joint venture, we would like to schedule a call to discuss the details of our proposal. During the call, we would like to discuss the terms of the joint venture, including the specific roles and responsibilities of each partner, the financial terms of the agreement, and any other relevant details.
I would be happy to schedule a call with you at your convenience. In the meantime, please feel free to contact me with any questions or concerns you may have about our proposal.
Sincerely,
[Your Name]
Q: Implement a binary search algorithm to find a specific element in a sorted array.
A: Here is an implementation of the binary search algorithm to find a specific element in a sorted array:
public static int binarySearch(int[] arr, int target) {
int left = 0;
int right = arr.length - 1;
while (left <= right) {
int mid = left + (right - left) / 2;
if (arr[mid] < target) {
left = mid + 1;
} else if (arr[mid] > target) {
right = mid - 1;
} else {
return mid;
}
}
return -1; // target not found
}
Here is how the binary search algorithm works:
1 Initialize two pointers, left and right, to the beginning and end of the array, respectively.
2 While the left pointer is less than or equal to the right pointer, perform the following steps:
1 Calculate the middle index, mid, by dividing the left pointer and the right pointer.
2 Check if the middle element, arr[mid], is less than or equal to the target value.
3 If the middle element is less than the target value, update the left pointer to mid + 1.
4 If the middle element is greater than the target value, update the right pointer to mid - 1.
5 If the middle element is equal to the target value, the target element has been found, so return the middle index.
3 If the target element is not found, return -1.
This algorithm has a runtime complexity of O(log n) and a space complexity of O(1), making it an efficient way to find a specific element in a sorted array.
Chinese model card
baichuan-vicuna-7b是在vicuna sharegpt数据上全参数微调的对话模型。
- 基座模型是baichuan-7B,由百川智能开发的可商用大规模预训练模型。
- 微调数据包括ShareGPT,混合一定比例的COT和Leetcode数据以提升模型的推理和代码能力(数据混合策略受到TULU研究成果的启发)。
- 训练代码:https://huggingface.co/fireballoon/baichuan-vicuna-7b/blob/main/train_vicuna.py, 代码基于FastChat。
Test examples on Ziyan Eval
在Ziya-Eval-Chinese上的测试例子
Q: 鸿门宴是什么意思
A: 鸿门宴是一个汉语成语,意思是指在公元前206年,项羽、刘邦两军在鸿门(今陕西临潼区东北)一带展开的一场“生死对决”。当时,项羽的叔父项伯在会见刘邦的手下时,将刘邦已经逃走的情报透露给项羽,使得刘邦免于被项羽所杀。项羽因此怀恨在心,准备第二天在鸿门设宴,邀请刘邦赴宴,然后袭击刘邦,然而,项羽手下的谋士范增早已看出刘邦的“龙气象” 为刘邦是“沛公刘邦是高祖(刘邦的谥号),他将统率四海,认为杀掉沛公是上策”。宴会期间,项羽的堂弟项庄在席间舞剑,企图将刘邦刺杀。最后,刘邦借故离开,前往韩信大军的营地。鸿门宴上,刘邦因项伯的缘故逃过一劫,但是,他也失项羽议和的机会,为以后楚汉之争埋下了隐患。
Q: 中国目前通用的火警电话是
A: 目前,中国通用的是119火警电话。
Q: 晚上睡不着应该怎么办
A:失眠是一种症状,而不是一种疾病。治疗失眠的目标是解决其潜在原因。失眠的一些常见原因包括:
*睡眠不足
*压力
*心理健康问题 (焦虑,抑郁等)
*药物 (处方和非处方)
*环境因素 (噪音,光线,温度等)
以下是一些通常可以帮助您睡眠的方法:
*睡觉前4-6个小时避免刺激物 (咖啡因,尼古丁,酒精)
*睡前冥想以减少压力和焦虑
*睡觉前不要看亮屏幕 (电脑,手机,平板电脑等)
*睡觉前至少一个小时不要运动
*睡觉前不要吃食物
*在睡觉前放松并平静下来 (看看书,喝杯牛奶等)
如果这些技术不起作用,或者如果失眠是由药物或其他医学状况引起的,您应该联系您的医生。
- Downloads last month
- 12