3 ms·
Still outputs natural language. Example from their colab: Input: I would like to translate from English to Chinese. Output: <<<domain>>>: Natural Language Pr
by csjh 3y ago
Still outputs natural language.
Example from their colab:
Input:
I would like to translate from English to Chinese.
Output:
<<<domain>>>: Natural Language Processing Text2Text Generation
<<<api_call>>>: M2M100ForConditionalGeneration.from_pretrained('facebook/m2m100_1.2B')
<<<api_provider>>>: Hugging Face Transformers
<<<explanation>>>: 1. Import M2M100ForConditionalGeneration and M2M100Tokenizer from the transformers library.
2. Load the pre-trained M2M100 model and tokenizer using the from_pretrained() method. The model is trained to translate text from English to Chinese, among other languages.
3. Encode the input text in English using the tokenizer.
4. Generate the translation using the model.generate() method.
5. Decode the output tokens using the tokenizer to obtain the translated text in Chinese.
6. Print the translated text.
- shishirpatil 3y agoHi @csjh, we trained to model to also additionally output additional context so it would be useful for a downstream task. We wrapped the API call with special decorator so it's easier to just regex. Would you like to just have the API instead? Happy to release an API only model if there is wider interest - It's a strictly easier task for Gorilla LLM :)