irins commited on
Commit
803c063
·
verified ·
1 Parent(s): 87deaf1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -13,8 +13,11 @@ def translate_text_hf(text):
13
  payload = {"inputs": text}
14
  response = requests.post(url, headers=headers, json=payload)
15
  if response.status_code == 200:
16
- return response.json()[0]['translation_text']
 
 
17
  else:
 
18
  return "Translation failed!"
19
 
20
  # Recipe search function using Spoonacular API
 
13
  payload = {"inputs": text}
14
  response = requests.post(url, headers=headers, json=payload)
15
  if response.status_code == 200:
16
+ translation = response.json()[0]['translation_text']
17
+ print("Translated ingredients:", translation) # Debug: Print translation
18
+ return translation
19
  else:
20
+ print("Translation failed with status:", response.status_code) # Debug: Print failure
21
  return "Translation failed!"
22
 
23
  # Recipe search function using Spoonacular API