Views
No views yet
curl --request GET \
--url http://127.0.0.1/language.json {
"info": "success",
"list": [
{
"id": "afrikaans",
"name": "\u5357\u975e\u8377\u5170\u8bed",
"serviceId": "af"
},
{
"id": "amharic",
"name": "\u963f\u59c6\u54c8\u62c9\u8bed",
"serviceId": "am"
},
{
"id": "english",
"name": "\u82f1\u8bed",
"serviceId": "en"
},
{
"id": "chinese_simplified",
"name": "\u7b80\u4f53\u4e2d\u6587",
"serviceId": "zh"
},
......
],
"result": 1
}curl --request POST \
--url http://127.0.0.1/translate.json \
--data 'text=["你好","世界"]' \
--data to=english{
"result": 1,
"text": [
"Hello",
"The world"
],
"time": 37,
"to": "english",
"tokens": 4
}| CPU computation | Is it accelerating | Memory usage | Translation time |
|---|---|---|---|
| Intel i7 7700k | accelerating | 2250MB | 43token/s |
| Intel i7 7700k | 970MB | 12token/s |
| GPU computation | Is it accelerating | GPU Memory Usage | Translation time |
|---|---|---|---|
| NVIDIA 1050TI | accelerating | 700MB | 83token/s |
| NVIDIA 1050TI | 700MB | 55token/s |
#sudo yum update -y
yum -y install wget
mkdir -p /mnt/translate100/
# Download pre compiled package
wget http://down.zvo.cn/centos/cpython-3.10.18+20250712-x86_64-unknown-linux-gnu-install_only.tar.gz -O /mnt/translate100/cpython-3.10.18.tar.gz
cd /mnt/translate100/
yum -y install tar
tar -xzf /mnt/translate100/cpython-3.10.18.tar.gz
rm -rf /mnt/translate100/cpython-3.10.18.tar.gz
# Configure environment variables
export PATH="/mnt/translate100/python/bin:$PATH"
# Add auto start upon startup
echo 'PATH="/mnt/translate100/python/bin:$PATH"'>>/etc/rc.d/rc.local
# Print the current Python version, which should be 3.10.18
python --version
# Installation environment, using Alibaba's source
pip install -i https://mirrors.aliyun.com/pypi/simple/ flask flask-cors transformers sentencepiece py-cpuinfo
#pip install -i https://mirrors.aliyun.com/pypi/simple/ --upgrade pip
pip install -i https://mirrors.aliyun.com/pypi/simple/ torch
# If using Nvidia GPU for computing, installation is required
#pip install torch==2.7.1 torchvision==0.22.1 torchaudio==2.7.1 --index-url https://download.pytorch.org/whl/cu128
# Permanently turn off the firewall (disable auto boot)
sudo systemctl disable firewalld
sudo systemctl stop firewalld
wget https://huggingface.co/xnx3/translate100/resolve/main/pytorch_model.bin?download=true -O /mnt/translate100/pytorch_model.bin
wget https://huggingface.co/xnx3/translate100/resolve/main/config.json?download=true -O /mnt/translate100/config.json
wget https://huggingface.co/xnx3/translate100/resolve/main/sentencepiece.bpe.model?download=true -O /mnt/translate100/sentencepiece.bpe.model
wget https://huggingface.co/xnx3/translate100/resolve/main/special_tokens_map.json?download=true -O /mnt/translate100/special_tokens_map.json
wget https://huggingface.co/xnx3/translate100/resolve/main/tokenization_small100.py?download=true -O /mnt/translate100/tokenization_small100.py
wget https://huggingface.co/xnx3/translate100/resolve/main/tokenizer_config.json?download=true -O /mnt/translate100/tokenizer_config.json
wget https://huggingface.co/xnx3/translate100/resolve/main/translate100.py?download=true -O /mnt/translate100/translate100.py
wget https://huggingface.co/xnx3/translate100/resolve/main/vocab.json?download=true -O /mnt/translate100/vocab.json
wget https://huggingface.co/xnx3/translate100/resolve/main/start.sh?download=true -O /mnt/translate100/start.sh
mkdir /mnt/translate100/resources/
wget https://huggingface.co/xnx3/translate100/resolve/main/resources/translate.js?download=true -O /mnt/translate100/resources/translate.js
# Add auto start upon startup
echo '/mnt/translate100/start.sh'>>/etc/rc.d/rc.local
chmod +x /etc/rc.d/rc.local
chmod +x /mnt/translate100/start.sh
chmod -R 777 /mnt/translate100/start.sh
# Run
/mnt/translate100/start.shTRANSLATE100_PORT=80TRANSLATE100_USE_GPU=trueTRANSLATE100_QUICK=trueset TRANSLATE100_PORT=80@inproceedings{mohammadshahi-etal-2022-small,
title = "{SM}a{LL}-100: Introducing Shallow Multilingual Machine Translation Model for Low-Resource Languages",
author = "Mohammadshahi, Alireza and
Nikoulina, Vassilina and
Berard, Alexandre and
Brun, Caroline and
Henderson, James and
Besacier, Laurent",
booktitle = "Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing",
month = dec,
year = "2022",
address = "Abu Dhabi, United Arab Emirates",
publisher = "Association for Computational Linguistics",
url = "https://aclanthology.org/2022.emnlp-main.571",
pages = "8348--8359",
abstract = "In recent years, multilingual machine translation models have achieved promising performance on low-resource language pairs by sharing information between similar languages, thus enabling zero-shot translation. To overcome the {``}curse of multilinguality{''}, these models often opt for scaling up the number of parameters, which makes their use in resource-constrained environments challenging. We introduce SMaLL-100, a distilled version of the M2M-100(12B) model, a massively multilingual machine translation model covering 100 languages. We train SMaLL-100 with uniform sampling across all language pairs and therefore focus on preserving the performance of low-resource languages. We evaluate SMaLL-100 on different low-resource benchmarks: FLORES-101, Tatoeba, and TICO-19 and demonstrate that it outperforms previous massively multilingual models of comparable sizes (200-600M) while improving inference latency and memory usage. Additionally, our model achieves comparable results to M2M-100 (1.2B), while being 3.6x smaller and 4.3x faster at inference.",
}
@inproceedings{mohammadshahi-etal-2022-compressed,
title = "What Do Compressed Multilingual Machine Translation Models Forget?",
author = "Mohammadshahi, Alireza and
Nikoulina, Vassilina and
Berard, Alexandre and
Brun, Caroline and
Henderson, James and
Besacier, Laurent",
booktitle = "Findings of the Association for Computational Linguistics: EMNLP 2022",
month = dec,
year = "2022",
address = "Abu Dhabi, United Arab Emirates",
publisher = "Association for Computational Linguistics",
url = "https://aclanthology.org/2022.findings-emnlp.317",
pages = "4308--4329",
abstract = "Recently, very large pre-trained models achieve state-of-the-art results in various natural language processing (NLP) tasks, but their size makes it more challenging to apply them in resource-constrained environments. Compression techniques allow to drastically reduce the size of the models and therefore their inference time with negligible impact on top-tier metrics. However, the general performance averaged across multiple tasks and/or languages may hide a drastic performance drop on under-represented features, which could result in the amplification of biases encoded by the models. In this work, we assess the impact of compression methods on Multilingual Neural Machine Translation models (MNMT) for various language groups, gender, and semantic biases by extensive analysis of compressed models on different machine translation benchmarks, i.e. FLORES-101, MT-Gender, and DiBiMT. We show that the performance of under-represented languages drops significantly, while the average BLEU metric only slightly decreases. Interestingly, the removal of noisy memorization with compression leads to a significant improvement for some medium-resource languages. Finally, we demonstrate that compression amplifies intrinsic gender and semantic biases, even in high-resource languages.",
}