sheonhan commited on
Commit
c757bee
1 Parent(s): ceaa373
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -16,11 +16,11 @@ headers = {"Authorization": f"Bearer {ACCESS_TOKEN}"}
16
 
17
  def query(payload):
18
  translation_response = requests.post(TRANSLATION_API_URL, headers=headers, json={
19
- "inputs": payload, "wait_for_model": True})
20
  translation = translation_response.json()[0]['translation_text']
21
 
22
  lang_id_response = requests.post(LANG_ID_API_URL, headers=headers, json={
23
- "inputs": payload, "wait_for_model": True})
24
  lang_id = lang_id_response.json()[0][0]
25
 
26
  return [lang_id, translation]
 
16
 
17
  def query(payload):
18
  translation_response = requests.post(TRANSLATION_API_URL, headers=headers, json={
19
+ "inputs": payload, "wait_for_model": True, "use_cache": True})
20
  translation = translation_response.json()[0]['translation_text']
21
 
22
  lang_id_response = requests.post(LANG_ID_API_URL, headers=headers, json={
23
+ "inputs": payload, "wait_for_model": True, "use_cache": True})
24
  lang_id = lang_id_response.json()[0][0]
25
 
26
  return [lang_id, translation]