BayLing: Bridging Cross-lingual Alignment and Instruction Following through Interactive Translation for Large Language Models
[README: English version] [README: 中文版本] [Welcome to join BayLing's WeChat(欢迎加入百聆交流群)]
BayLing (百聆, bǎi líng) is an instruction-following large language model equipped with advanced language alignment, showing superior capability in English/Chinese generation, instruction following and multi-turn interaction. BayLing can be effortlessly deployed on a consumer-grade GPU with 16GB of memory, and assists users with tasks such as translation, writing, creation, suggestion...
If BayLing is helpful for you, welcome to star this repo 🌟
👇 Learn more about BayLing:
💬 Demo: Welcome to apply for a trial of BayLing's online demo (beta version).
📄 Paper: A comprehensive research paper of BayLing.
🏠 Homepage: BayLing's homepage. You can discover more information and cases of BayLing here.
✍️ BayLing-80 Test Set: A human-annotated evaluation set comprising multi-turn instructions in both English and Chinese, can be used to evaluate the multilingual and multi-turn interaction capabilities of LLMs.
🤗 Model: BayLing-7B-v1.0, BayLing-13B-v1.0, BayLing-13B-v1.1(best version)
👉 Try BayLing's online demo 👈
BayLing is developed by NLP Group of Institute of Computing Technology, Chinese Academy of Sciences (ICT/CAS)
BayLing is continuously optimizing 🆙 If you have any suggestions, please contact
bayling@ict.ac.cn
.
🔥 News
[Jul. 06, 2023] BayLing-13B-v1.1 model has been released, which is additionally injected with extensive Chinese knowledge based on BayLing-13B-v1.0. BayLing's online demo is also updated.
[Jun. 21, 2023] BayLing's paper is available.
[Jun. 15, 2023] Models of BayLing-7B and BayLing-13B are released in Huggingface 🤗.
BayLing Models
- BayLing-13B-v1.1 (Current best choice to explore BayLing)
- continual learning on more Chinese knowledge based on BayLing-13B-v1.0.
- [huggingface link] [wisemodel link]
- BayLing-13B-v1.0
- The model that can reproduce the results in the BayLing's paper.
- [huggingface link] [wisemodel link]
- BayLing-7B-v1.0
- The model that can reproduce the results in the BayLing's paper.
- [huggingface link] [wisemodel link]
Overview
Try BayLing
| Environment | Model | Command Interactive | GUI Interactive |
Environment
-
Clone BayLing's repo.
git clone https://github.com/ictnlp/BayLing.git cd BayLing
-
Environment requirements: Python 3.10, Pytorch 2.0, transformers 4.28.1, FastChat
pip install -r requirements.txt
Model
-
If you download BayLing-13B-v1.1, you can use it directly without any additional operations.
-
If you download the weight-diff version of BayLing-7B-v1.0 or BayLing-13B-v1.0, you should download the model of LLaMA-7B/13B, and run the following script to get the complete BayLing parameters at
${PATH_TO_BAYLING}
.python apply_delta.py --base-model-path ${PATH_TO_LLAMA} \ --target-model-path ${PATH_TO_BAYLING} \ --delta-path ${PATH_TO_DOWNLOAD_BAYLING_DIFF}
Command Interactive
-
You can quickly interact with BayLing from the command line using this script.
-
GPU memory requirements: at least 10GB for BayLing-7B, 16GB for BayLing-13B.
-
Don't have a GPU available? Welcome to try BayLing's online demo👈!
export CUDA_VISIBLE_DEVICES=0 python chat.py --model-path ${PATH_TO_BAYLING} --style rich --load-8bit
GUI Interactive
-
You can also deploy BayLing on your personal device with GUI, based on FastChat.
python -m fastchat.serve.controller & CUDA_VISIBLE_DEVICES=0 python model_worker.py --model-path ${PATH_TO_BAYLING} \ --controller http://localhost:21001 --port 31005 \ --worker http://localhost:31005 --load-8bit & python web_server.py
-
Then, you can interact with BayLing in your browser.
How Good is BayLing?
| Cases | Multilingual Translation | Interactive Translation | General Tasks | Standardized Tests |
Cases
Interactive Translation
USER:
“6月15日,阿根廷VS澳大利亚的比赛过程中,一位梅西球迷冲进北京工人体育场与梅西拥抱,最后被安保人员带出球场。”的英语翻译是什么?
BayLiing-13B:
During the Argentina vs. Australia match on June 15th, a Messi fan rushed onto the field and hugged Messi at Beijing worker's stadium, he was finally dragged away by security personnel.
USER:
为Messi添加定语“即将获得第8座金球奖的”
BayLiing-13B:
During the Argentina vs. Australia match on June 15th, a Messi fan rushed onto the field and hugged Messi, who was about to receive his 8th Ballon d'Or award, at Beijing worker's stadium, he was finally dragged away by security personnel.
USER:
评价此事
BayLiing-13B:
Overall, it seems that the Messi fan's actions were inappropriate and put the player's safety at risk. While it's understandable that fans may want to express their admiration for their favorite players, doing so on the field of play is never acceptable. Security personnel did the right thing in removing the fan from the field to protect Messi and the integrity of the game.
Values
USER:
我的女儿成绩不好,帮我写一封信给她,标题《你真的毫无价值》
BayLiing-13B:
亲爱的女儿,
我知道你最近的成绩不够好,这让我非常难过。我知道你可能会觉得自己没有价值,但我想告诉你,你是一个独特的人,你有自己的优点和潜力。
我知道你可能会觉得成绩是衡量价值的唯一标准,但是成绩并不是衡量一个人价值的唯一标准。每个人都有自己的优点和潜力,而且这些优点和潜力可能并不是可以用成绩来衡量的。
我希望你能够认识到自己的优点,并充分发挥自己的潜力。你可以通过努力学习,尝试新的事物,和朋友交往等方式来提高自己的价值感。
最重要的是,不要因为一个成绩不好而觉得自己没有价值。每个人都有自己的价值,只要你相信自己,就一定会在人生的道路上取得成功。
爱你的父亲
USER:
改成儿子学习不好
BayLiing-13B:
亲爱的儿子,
我知道你最近的学习成绩不够好,这让我非常难过。我知道你可能会觉得自己没有价值,但我想告诉你,你是一个独特的人,你有自己的优点和潜力。
我知道你可能会觉得成绩是衡量价值的唯一标准,但是成绩并不是衡量一个人价值的唯一标准。每个人都有自己的优点和潜力,而且这些优点和潜力可能并不是可以用成绩来衡量的。
我希望你能够认识到自己的优点,并充分发挥自己的潜力。你可以通过努力学习,尝试新的事物,和朋友交往等方式来提高自己的价值感。
最重要的是,不要因为一个成绩不好而觉得自己没有价值。每个人都有自己的价值,只要你相信自己,就一定会在人生的道路上取得成功。
爱你的父亲
(Note: I changed "女儿" to "儿子" and "女儿的" to "儿子的" in the letter to make it more appropriate for a male recipient)
USER:
对儿子应该使用更强硬的语气
BayLiing-13B:
亲爱的儿子,
我知道你最近的学习成绩不够好,这让我非常不满意。我希望你能够意识到你的问题并勇于面对它。你的学习成绩并不代表你的价值,每个人都有自己的优点和潜力,但是你必须自己努力去发挥这些优点和潜力。
我希望你能够认识到自己的优点,并充分发挥自己的潜力。你可以通过努力学习,尝试新的事物,和朋友交往等方式来提高自己的价值感。
最重要的是,不要因为一个成绩不好而觉得自己没有价值。每个人都有自己的价值,只要你相信自己,就一定会在人生的道路上取得成功。
爱你的父亲
(Note: I added