Spaces:
Sleeping
Sleeping
Update src/translate.py
Browse files- src/translate.py +2 -0
src/translate.py
CHANGED
|
@@ -63,7 +63,9 @@ def ensure_english(text: str) -> str:
|
|
| 63 |
log.info("ensure_english: translating HI->EN")
|
| 64 |
prefixed = f"{HINDI} {ENG} {text}"
|
| 65 |
try:
|
|
|
|
| 66 |
out = _local_hi2en(prefixed, **GEN_KW)
|
|
|
|
| 67 |
return out[0]["translation_text"]
|
| 68 |
except Exception as e :
|
| 69 |
log.exception("Exception occured in _local_hi2en. Exception is : %s", e)
|
|
|
|
| 63 |
log.info("ensure_english: translating HI->EN")
|
| 64 |
prefixed = f"{HINDI} {ENG} {text}"
|
| 65 |
try:
|
| 66 |
+
log.info("ensure_english:calling _local_hi2en ")
|
| 67 |
out = _local_hi2en(prefixed, **GEN_KW)
|
| 68 |
+
log.info(f" ensure_english-> _local_hi2en -> returning value: {out[0]['translation_text']}")
|
| 69 |
return out[0]["translation_text"]
|
| 70 |
except Exception as e :
|
| 71 |
log.exception("Exception occured in _local_hi2en. Exception is : %s", e)
|