Update main.py
Browse files
main.py
CHANGED
@@ -11,7 +11,7 @@ def translate():
|
|
11 |
enpt_pipeline = pipeline('text2text-generation', model=model, tokenizer=tokenizer, max_length=512, num_beams=5)
|
12 |
|
13 |
content = request.json
|
14 |
-
|
15 |
result = enpt_pipeline(f"translate English to Portuguese: {text_to_translate}")
|
16 |
return jsonify({"translated_text": result[0]["generated_text"]})
|
17 |
|
|
|
11 |
enpt_pipeline = pipeline('text2text-generation', model=model, tokenizer=tokenizer, max_length=512, num_beams=5)
|
12 |
|
13 |
content = request.json
|
14 |
+
text_to_translate = content['text']
|
15 |
result = enpt_pipeline(f"translate English to Portuguese: {text_to_translate}")
|
16 |
return jsonify({"translated_text": result[0]["generated_text"]})
|
17 |
|