Updated translate template

added test file
This commit is contained in:
bacon
2023-08-27 10:36:30 +03:00
parent f6312f7207
commit 30ffadfd5c
3 changed files with 18 additions and 21 deletions

View File

@@ -32,10 +32,9 @@ def translate(_input, lang='RU'):
"commonJobParams": {},
"timestamp": int(round(time.time() * 1000))
},
"id": 40890008
"id": _id
}
)
print(_id)
try:
return r.json()['result']['translations'][0]['beams'][0]['postprocessed_sentence']
except: