Model Overview
Model Features
Model Capabilities
Use Cases
đ Vicuna Baichuan-13B Model
A Vicuna fine-tuned dialogue model based on Baichaun-13B-chat
The shibing624/vicuna-baichuan-13b-chat model is evaluated on test data. The overall performance of the model on the QA test is as follows:
Input Text | Prediction |
---|---|
What kind of medicine can a one-year-old baby take when having a fever? | When a 1-year-old baby has a fever, the following types of medicines can be considered: 1. Antipyretic drugs: such as Ibuprofen or Paracetamol. These drugs can help reduce body temperature and relieve fever symptoms. 2. Antibiotics: If the fever is caused by a bacterial infection, antibiotics can be considered. However, please use them under the advice of a doctor. 3. Antiviral drugs: If the fever is caused by a viral infection, antiviral drugs can be considered. But please use them under the advice of a doctor. 4. Antipyretic and analgesic drugs: such as Aspirin or Paracetamol. These drugs can help relieve fever symptoms. 5. Antihistamines: such as Diphenhydramine or Naproxen. These drugs can help relieve fever symptoms. Please use these medicines under the advice of a doctor and follow the dosage and usage instructions on the medicine label. At the same time, ensure that the baby has sufficient water intake and enough rest. |
This model performs excellently in the Chinese open test set, inheriting the advantages of two aspects:
- The base model for fine-tuning is the baichuan-inc/Baichuan-13B-Chat model, which is a powerful Chinese-English base model.
- The fine-tuning uses a high-quality dataset of 100,000 multilingual GPT4 dialogues. After fine-tuning, the model has reached a leading level in general conversations, including the ability to answer medical questions. Its ability to answer general questions is not inferior to that of Baichuan-13B-Chat.
đ Documentation
Training details
The training arguments are as follows:
{"per_device_train_batch_size": 2,
"per_device_eval_batch_size": 2,
"gradient_accumulation_steps": 1,
"learning_rate": 2e-05,
"num_train_epochs": 3.0,
"max_steps": -1,
"lr_scheduler_type": "linear",
"warmup_ratio": 0.0,
"warmup_steps": 50,
"save_strategy": "steps",
"save_steps": 500,
"save_total_limit": 13,
"seed": 42,
"bf16": true,
"fp16": false,
"eval_steps": 50,
"remove_unused_columns": false,
"load_best_model_at_end": true,
"metric_for_best_model": "loss",
"optim": "paged_adamw_32bit",
"report_to": ["tensorboard"]}
- Training loss: 1.3209
- Evaluation loss: 1.4953
The following bitsandbytes
quantization configuration was used during training:
- load_in_8bit: False
- load_in_4bit: True
- llm_int8_threshold: 6.0
- llm_int8_skip_modules: None
- llm_int8_enable_fp32_cpu_offload: False
- llm_int8_has_fp16_weight: False
- bnb_4bit_quant_type: nf4
- bnb_4bit_use_double_quant: True
- bnb_4bit_compute_dtype: bfloat16
đģ Usage Examples
Basic Usage
This project is open-sourced on the following GitHub repositories:
You can use the textgen library to call the Baichuan/LLaMA models.
Install the package:
pip install -U textgen
from textgen import GptModel
def generate_prompt(instruction):
return f"""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: {instruction} ASSISTANT: """
model = GptModel("baichuan", "shibing624/vicuna-baichuan-13b-chat")
predict_sentence = generate_prompt("What kind of medicine can a one-year-old baby take when having a fever?")
r = model.predict([predict_sentence])
print(r) # ["1. First, most pediatric antipyretics contain antipyretic and analgesic ingredients such as Aspirin or Ibuprofen. Although these drugs have fewer side effects, there is also a risk of gastrointestinal damage or even gastrointestinal ulcer bleeding if used in excess..."]
Advanced Usage
Without using the textgen library, you can use the model as follows:
First, pass your input through the transformer model, and then you can get the generated sentence.
Install the package:
pip install transformers
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer, GenerationConfig
model = AutoModelForCausalLM.from_pretrained("shibing624/vicuna-baichuan-13b-chat", device_map='auto', torch_dtype=torch.float16, trust_remote_code=True)
model.generation_config = GenerationConfig.from_pretrained("shibing624/vicuna-baichuan-13b-chat", trust_remote_code=True)
tokenizer = AutoTokenizer.from_pretrained("shibing624/vicuna-baichuan-13b-chat", trust_remote_code=True)
device = torch.device(0) if torch.cuda.is_available() else torch.device("cpu")
def generate_prompt(instruction):
return f"""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: {instruction} ASSISTANT: """
sents = ['What kind of medicine can a one-year-old baby take when having a fever?', "Who are you?"]
for s in sents:
q = generate_prompt(s)
inputs = tokenizer(q, return_tensors="pt")
inputs = inputs.to(device)
generate_ids = model.generate(
**inputs,
max_new_tokens=512,
)
output = tokenizer.batch_decode(generate_ids, skip_special_tokens=True)[0]
print(output)
print()
Output:
What kind of medicine can a one-year-old baby take when having a fever?
A child's body is very fragile. If you don't take good care of yourself, you may get various diseases. Some parents are very anxious when they see their children get sick and want to give them medicine immediately. But in fact, it's not that simple because everyone's sensitivity and tolerance to drugs are different. So we need to choose the appropriate treatment method according to the specific situation to achieve the best effect. 1. First, most pediatric antipyretics contain antipyretic and analgesic ingredients such as Aspirin or Ibuprofen. Although these drugs have fewer side effects, there is also a risk of gastrointestinal damage or even gastrointestinal ulcer bleeding if used in excess. 2. Some pediatric antipyretics contain antihistamines such as Chlorpheniramine. They are prescription drugs and should be taken strictly according to the doctor's advice. Do not increase or decrease the dosage or extend the medication time without permission. 3. In addition, some pediatric antipyretics contain nutritional supplements such as Vitamin C and Calcium Gluconate. They should only be considered when the child has dehydration symptoms (such as thirst and dark urine). Otherwise, it is easy to cause electrolyte imbalance.
Model file composition:
vicuna-baichuan-13b-chat
âââ config.json
âââ configuration_baichuan.py
âââ generation_config.json
âââ modeling_baichuan.py
âââ pytorch_model-00001-of-00003.bin
âââ pytorch_model-00002-of-00003.bin
âââ pytorch_model-00003-of-00003.bin
âââ pytorch_model.bin.index.json
âââ quantizer.py
âââ special_tokens_map.json
âââ tokenization_baichuan.py
âââ tokenizer_config.json
âââ tokenizer.model
- Inference GPU: 27G
Inference Examples
Human | Assistant |
---|---|
What should I do if my child has a fever? | Fever is a natural response of the body to infection or other diseases. Here are some suggestions to help relieve fever symptoms: 1. Keep the body hydrated: When having a fever, the body loses water, so it is necessary to keep hydrated. 2. Use an ice pack: Placing an ice pack on the forehead or neck can help reduce body temperature. 3. Use antipyretic drugs: Antipyretic drugs can help reduce body temperature. 4. Keep the body warm: Keeping the body warm can help reduce body temperature. 5. Wipe the body with cold or warm water: Wiping the body with cold or warm water can help reduce body temperature. 6. Use antipyretic drugs: Antipyretic drugs can help reduce body temperature. 7. Keep the body warm: Keeping the body warm can help reduce body temperature. 8. Wipe the body with cold or warm water: Wiping the body with cold or warm water can help reduce body temperature. 9. Use antipyretic drugs: Antipyretic drugs can help reduce body temperature. 10. Keep the body warm: Keeping the body warm can help reduce body temperature. |
What kind of medicine can a one-year-old baby take when having a fever? | When a 1-year-old baby has a fever, the following types of medicines can be considered: 1. Antipyretic drugs: such as Ibuprofen or Paracetamol. These drugs can help reduce body temperature and relieve fever symptoms. 2. Antibiotics: If the fever is caused by a bacterial infection, antibiotics can be considered. However, please use them under the advice of a doctor. 3. Antiviral drugs: If the fever is caused by a viral infection, antiviral drugs can be considered. But please use them under the advice of a doctor. 4. Antipyretic and analgesic drugs: such as Aspirin or Paracetamol. These drugs can help relieve fever symptoms. 5. Antihistamines: such as Diphenhydramine or Naproxen. These drugs can help relieve fever symptoms. Please use these medicines under the advice of a doctor and follow the dosage and usage instructions on the medicine label. At the same time, ensure that the baby has sufficient water intake and enough rest. |
What diseases might anal lesions be a symptom of? | Anal lesions can be caused by various reasons, including infection, inflammation, tumors, or other diseases. Some common anal lesions include: 1. Anal fissure: This is a tear in the anal skin, usually caused by constipation or other pressure factors. 2. Anal fistula: This is an anal infection that causes a fistula to form between the anal skin and the rectum. 3. Anal warts: These are wart-like lesions that form on the anal skin, usually caused by the Human Papillomavirus (HPV). 4. Anal abscess: This is an anal infection that causes an abscess to form under the anal skin. 5. Anal tumor: This is a tumor that forms in the anal skin or rectum. 6. Anal ulcer: This is an ulcer that forms on the anal skin, usually caused by infection or inflammation. 7. Anal itching: This is a symptom of anal skin itching, which may be caused by infection, inflammation, or other diseases. If you have symptoms of anal lesions, please consult a healthcare professional for proper diagnosis and treatment. |
Doctor, hello. Why is my leucorrhea increasing and turning yellow? | Hello, increased and yellowish leucorrhea can be caused by various reasons, including infection, hormonal changes, vaginal dryness, or other gynecological problems. Here are some possible reasons: 1. Infection: Increased and yellowish leucorrhea may be caused by a vaginal or urinary tract infection. The infection may be caused by bacteria, viruses, or fungi. 2. Hormonal changes: Hormonal changes, such as during the menstrual cycle or menopause, may cause increased and yellowish leucorrhea. 3. Vaginal dryness: Vaginal dryness may cause increased and yellowish leucorrhea. 4. Other gynecological problems: Other gynecological problems, such as cervicitis, endometritis, or endometriosis, may also cause increased and yellowish leucorrhea. If you are worried about your leucorrhea, it is recommended that you consult a gynecologist for an examination and diagnosis. The doctor can determine the cause based on your symptoms and examination results and provide appropriate treatment. |
Does having chocolate-colored leucorrhea after a medical abortion mean the abortion was incomplete? | Having chocolate-colored leucorrhea after a medical abortion does not necessarily mean that the abortion was incomplete. Chocolate-colored leucorrhea is caused by the shedding of the endometrium and bleeding, which usually occurs within a period of time after a medical abortion. The reasons for chocolate-colored leucorrhea after a medical abortion may include: 1. Endometrial shedding: After a medical abortion, the endometrium sheds, causing bleeding. This bleeding may appear as chocolate-colored leucorrhea. 2. Infection: After a medical abortion, there may be trauma to the endometrium and cervix, making it easy to be infected by bacteria. Infection may cause chocolate-colored leucorrhea. 3. Hormonal changes: After a medical abortion, hormonal levels may change, causing chocolate-colored leucorrhea. If the chocolate-colored leucorrhea persists for a long time or is accompanied by other symptoms such as abdominal pain, fever, or a foul-smelling discharge, it is recommended to seek medical attention in time and have relevant examinations such as a gynecological examination and B-ultrasound to determine whether there is an infection or other problems. Receive appropriate treatment under the guidance of a doctor. |
What diseases can Viaminate Vitamin E Cream treat? | Viaminate Vitamin E Cream is an external medicine mainly used to treat skin diseases such as acne and seborrheic dermatitis. It can help reduce skin oil secretion, relieve inflammation, and promote skin repair. It should be noted that Viaminate Vitamin E Cream is not a panacea and may not be suitable for certain skin diseases. Before use, it is recommended to consult a doctor or pharmacist to understand the indications, contraindications, usage, and dosage of the medicine. At the same time, use the medicine according to the doctor's advice and avoid self-abuse. |
What causes acne? | Acne, also known as pimples, is caused by clogged skin pores. There are many reasons for clogged pores, including: 1. Overactive sebaceous glands: The sebaceous glands produce too much oil, causing the pores to clog. 2. Pore blockage: Dead skin cells, oil, and bacteria on the skin surface clog the pores. 3. Inflammation: Acne is usually accompanied by inflammation, which may be caused by skin infection or the immune system's response to acne. 4. Genetic factors: Some people may be more prone to acne, which may be caused by genetic factors. 5. Hormonal changes: Acne is more common during puberty and menstruation, which may be caused by hormonal changes. 6. Lifestyle factors: Certain lifestyle factors, such as stress, a poor diet, and lack of exercise, may also cause acne. 7. Cosmetics and skin care products: Some cosmetics and skin care products may cause acne, especially those containing irritating ingredients. 8. Medications: Some medications, such as oral contraceptives, may also cause acne. To prevent acne, you can take some measures, such as keeping your skin clean, using mild skin care products, avoiding excessive use of cosmetics and skin care products, maintaining a healthy lifestyle and diet, and avoiding stress and hormonal changes. If your acne is severe, you may need to seek the help of a dermatologist. |
What should I do if I have acne on my face? What medicine can I take? What should I pay attention to? | Acne, also known as pimples, is a common skin disease. The treatment of acne needs to comprehensively consider diet, lifestyle, medications, and other aspects. Here are some suggestions: 1. Diet: * Avoid high-sugar, high-fat, and high-oil foods, such as fast food, desserts, and fried foods. * Eat more fresh vegetables, fruits, and whole grains to increase fiber intake and promote intestinal peristalsis. * Avoid consuming too much caffeine, alcohol, spicy foods, and other irritating foods. 2. Lifestyle: * Maintain a good work and rest schedule and ensure sufficient sleep. * Avoid using electronic products such as computers and mobile phones for a long time to avoid skin irritation from radiation. * Keep your skin clean and use a mild cleanser to clean your skin morning and evening. * Avoid squeezing acne to prevent infection and scarring. 3. Medications: * External medications: You can use skin care products containing ingredients such as salicylic acid, benzoic acid, and azelaic acid to help remove dead skin cells from the skin surface and reduce the formation of acne. * Oral medications: If your acne is severe, you can consider taking oral antibiotics, Vitamin B complex, zinc, and other medications, but they should be used under the guidance of a doctor. 4. Precautions: * Do not use cosmetics and skin care products randomly to avoid skin irritation. * Do not over-clean your skin to avoid damaging the skin barrier. * Keep a good mood and avoid negative emotions such as anxiety and depression. In short, the treatment of acne needs to comprehensively consider diet, lifestyle, medications, and other aspects. During the treatment process, you need to be patient and confident, follow the doctor's advice, and gradually improve your skin condition. |
Can vas deferens blockage lead to male infertility? Doctor, hello. My colleague has been unhappy these days. I asked her what was wrong, and she said that her husband has a vas deferens blockage, so they haven't been able to have a child. It's not that they don't want to. So, can vas deferens blockage lead to male infertility? | Vas deferens blockage may lead to male infertility. The vas deferens is a tube that connects the testicles to the urethra and is responsible for transporting sperm from the testicles to the urethra. If the vas deferens is blocked, sperm cannot pass through the vas deferens to reach the urethra, resulting in infertility. There are many reasons for vas deferens blockage, including congenital developmental abnormalities, inflammation, tumors, trauma, etc. The treatment methods for vas deferens blockage include surgical dredging and drug treatment. If the vas deferens blockage is severe, surgical dredging may be required. It should be noted that vas deferens blockage does not necessarily lead to infertility because there are other ways to transport sperm into the female body. For example, sperm can reach the female body through the epididymis, prostate, and other tissues. Therefore, if there is a vas deferens blockage, it is recommended to seek medical attention in time and get the help of a professional doctor. |
Can myocardial infarction be treated? | Myocardial infarction is a serious disease. If treated in time, it can save lives and prevent long-term disability. The key to treating myocardial infarction is early recognition and treatment. The treatment of myocardial infarction usually includes the following steps: 1. Seek medical attention immediately: If you experience symptoms such as chest pain, shortness of breath, or fainting, seek medical attention immediately. 2. Drug treatment: The doctor may prescribe medications, such as nitroglycerin or aspirin, to help relieve symptoms. |
đ License
This project is licensed under the "apache-2.0" license.

