Text Generation
Transformers
PyTorch
Chinese
English
llama
text-generation-inference
Edit model card

baichuan-vicuna-7b

baichuan-vicuna-7b is a chat model supervised finetuned on vicuna sharegpt data.

中文说明

[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
4
Inference API (serverless) has been turned off for this model.

Datasets used to train fireballoon/baichuan-vicuna-7b