translate100 Translate100 is a seq to seq architecture and Transformer based neural machine translation model used for translation tasks. It is a one click deployment application that is fully adapted to translate.js, obtained by distilling (small100) and processing m2m100 (12B). Its translation ability is average, and its biggest feature is running on ultra-low configuration terminals (1 core 2G memory) and adapting to hundreds of mainstream languages worldwide.
1. In GPU free scenarios, CPUs that support quantization instructions will perform int8 quantization on the Linear layer to improve running speed. 2. Disable gradient calculation and turn off other functions of the automatic differentiation engine to further improve performance and reduce memory usage 3. Hybrid precision acceleration, when GPU is detected, dynamically selects FP16/FP32 precision for calculation, reducing memory usage and improving throughput while maintaining precision. 4. Optimize strategies for automatic switching between CPU and GPU environments to ensure optimal performance on different hardware. 5. It has an open standard text translation interface, one click deployment, no configuration required, and can be used on ultra-low configuration cloud servers (such as 1 core 2G). 6. Supports translation into 100 languages. 7. No need to specify the original text, self recognize the input translated text, and output the translation. 8. Support multiple languages in one sentence.
Using in API mode It mainly provides usage through open APIs and universal HTTP interface requests.
Response: ` result 1 represents success, 0 represents failure. If it returns 0 and fails, the failure information can be obtained through info. list Language list, each element is a language, containing: id Language identification, such as : english name Language name, such as : English info The failure message will only be returned when the result is 0.
/translate.json - Text translation Api CRUL request:
` text The text to be translated. If there is only one text, string format is supported. If there are multiple texts, array format is supported, with each element representing a text to be translated. to The target language can be obtained by passing in specific values such as : english , which can be obtained through /language.json
` result 1 represents success, 0 represents failure. If it returns 0 and fails, the failure information can be obtained through info. text The translated text is always in array format. to Target language, corresponding to the incoming 'to' time Translation time, measured in milliseconds. tokens The number of tokens for translating the incoming content. info The failure message will only be returned when the result is 0.
/ Home, Health Check Directly accessible http://127.0.0.1 You can see a welcome page, which is a simple HTML page containing some basic information. In addition, if you need to perform load health checks, you can also use this as a health check page.
| 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 |
Minimum operating requirements A regular cloud server with a very low configuration of 1 core and 2G memory can run, with a translation rate exceeding 1 token/s.
Private deployment Linux Here is a way to deploy on CentOS 7.4 and open port 80 for use:
` Windows Download the application: Double click to directly open and run. (Note that after double clicking to run, there will be a loading process for a few minutes, and it feels like there is no response after opening. It is reading data, please be patient.)
Configuration parameter It provides the ability to set relevant parameters in the form of system environment variables to control the operation of translate100.
TRANSLATE100PORT The port number set for the environment variable is 80 by default `
TRANSLATE100USEGPU Whether to use GPU for setting environment variables, default to true Setting it to false means that even if there is a GPU, it is not necessary and the CPU is forced to be used `
TRANSLATE100QUICK Whether to use fast mode for setting environment variables, if not set by default, it will not be enabled. The fast mode will significantly accelerate the translation speed, while slightly reducing the quality of the translation. If you are running on a CPU He will check if the AVX2 instruction set is supported, and if so, automatically perform int8 quantization on the Linear layer to improve running speed. He will check if channelslast is supported, and if so, automatically transform the model to improve running speed. Do not use beam search, only use greedy search. If you are running on a GPU (Nvidia) Semi precision quantization Optimize resource utilization efficiency and achieve adaptive performance tuning Do not use beam search, only use greedy search.
Example of Windows Port Number Setting Here is an example of changing the default port number from 80 to 8000 when running on a Windows system Firstly, open the cmd command window and enter: ` Then double-click to run translate100.exe. After startup, you can use port 8000 to make requests
If you use this model for your research, please cite the following work: