Code Monkey home page Code Monkey logo

multilingualsift's Introduction

Multilingual Supervised Instruction Fine-tuning

This repo aims to provide the data, models, evaluation benchmark for multilingual instruction fine-tuning.

๐Ÿ“š Data

We translate Alpaca-GPT4 and Evol-Instruct from English to languages using GPT-3.5 Turbo, where

  • For Alpaca-GPT4, we directly translate the instructions and responses.
  • For Evol-Instruct, we translate the instructions and use to generate the responses using the translated instructions.
  • For ShareGPT, we translate the English data from ShareGPT to other languages (Note: Due to the large scale of ShareGPT, we have yet to translate all the data).
Language Alpaca-GPT4 Evol-instruct ShareGPT
Chinese [huggingface] [huggingface] [huggingface]
Japanese [huggingface] [huggingface] [huggingface]
Korean [huggingface] [huggingface] [huggingface]
German [huggingface] [huggingface] [huggingface]
French [huggingface] [huggingface] [huggingface]
Italian [huggingface] [huggingface] [huggingface]
Arabic [huggingface] [huggingface] [huggingface]
Portuguese [huggingface] [huggingface] [huggingface]
Spanish [huggingface] [huggingface] [huggingface]
Hindi [huggingface] [huggingface] [huggingface]
Indonesian [huggingface] [huggingface] [huggingface]

๐Ÿค– Models

CLI Interation

python -m src.deploy.cli --model-path /path/to/weights/

For example, you can use FreedomIntelligence/phoenix-multiple-langs-v1 fine-tuned on eight languages (English, Chinese, French, Spanish, Portuguese, Arabic, Indonesian, Hindi):

python -m src.deploy.cli --model-path FreedomIntelligence/phoenix-multiple-langs-v1

Deployment

  1. Launch a controller
python -m src.deploy.webapp.controller
  1. Launch a model worker
python -m src.deploy.webapp.model_worker --model-path /path/to/weights/
  1. Launch a gradio web server
python -m src.deploy.webapp.gradio_web_server

Now, you can open your browser and chat with a model.

Training

Specify the train_data_path and val_data_path and then run

bash scripts/train.sh

๐Ÿ’ฏ Evaluation Benchmark

Evaluation Data

  • We translate MMLU and Vicuna-80 to languages above for evaluation.
Language MMLU
Chinese [huggingface]
Japanese [huggingface]
Korean [huggingface]
German [huggingface]
French [huggingface]
Italian [huggingface]
Arabic [huggingface]
Portuguese [huggingface]
Spanish [huggingface]
Hindi [huggingface]
Indonesian [huggingface]

Evaluation

  • For MMLU
bash scripts/eval_mmlu.sh ${LANGUAGE} ${MODEL_PATH} ${MODEL_ID}
  • For Vicuna-80
bash scripts/eval_vicuna-80.sh ${LANGUAGE} ${MODEL_PATH} ${MODEL_ID}

Citation

If you find this repository helpful, please cite the repository below.

@software{Chen_MultilingualSIFT_Multilingual_Supervised_2023,
author = {Chen, Zhihong and Yan, Shuo and Liang, Juhao and Jiang, Feng and Wu, Xiangbo and Yu, Fei and Chen, Guiming Hardy and Chen, Junying and Zhang, Hongbo and Li Jianquan and Wan Xiang and Wang, Benyou},
month = jul,
title = {{MultilingualSIFT: Multilingual Supervised Instruction Fine-tuning}},
url = {https://github.com/FreedomIntelligence/MultilingualSIFT.git},
version = {0.1},
year = {2023}
}

multilingualsift's People

Contributors

zhjohnchan avatar shuoyan97 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.