Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 |
-
|
|
|
|
|
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
|