English to Spanish (ibm/granite-20b-multilingual)
POST {{baseUrl}}/ml/v1/text/generation?version=2023-05-29
Request Params
Key | Datatype | Required | Description |
---|---|---|---|
version | string |
Request Body
{"input"=>"Translate the following text from English to Spanish:\n\nText: So far, I have not been terribly encouraged by the stance adopted by the Commission.\nTranslation: Hasta ahora no me ha animado mucho la postura adoptada por la ComisiΓ³n.\n\nText: I am very pleased to see that the joint resolution adopts the suggestion we made.\nTranslation:", "parameters"=>{"decoding_method"=>"sample", "max_new_tokens"=>1024, "min_new_tokens"=>1, "random_seed"=>42, "stop_sequences"=>["\n"], "temperature"=>0.5, "top_k"=>50, "top_p"=>0.75, "repetition_penalty"=>1}, "model_id"=>"ibm/granite-20b-multilingual", "project_id"=>"{{projectId}}", "moderations"=>{"hap"=>{"input"=>{"enabled"=>true, "threshold"=>0.5, "mask"=>{"remove_entity_value"=>true}}, "output"=>{"enabled"=>true, "threshold"=>0.5, "mask"=>{"remove_entity_value"=>true}}}}}
RESPONSES
status: OK
{"model_id":"ibm/granite-20b-multilingual","created_at":"2024-04-05T21:22:09.121Z","results":[{"generated_text":" Estoy muy contento de ver que la resoluciΓ³n conjunta adopta la sugerencia que hicimos.","generated_token_count":26,"input_token_count":88,"stop_reason":"eos_token","seed":42,"moderations":{"hap":[{"score":0.5639350414276123,"input":false,"position":{"start":1,"end":87},"entity":"has_HAP","word":"Estoy muy contento de ver que la resoluciΓ³n conjunta adopta la sugerencia que hicimos."}]}}]}