Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve translation handling #175

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

svenseeberg
Copy link
Member

@svenseeberg svenseeberg commented Jan 21, 2025

This PR does multiple things:

Fix Munich kmr support

curl -v -s -X POST https://igchat-inference.tuerantuer.org/translate/message/ -d'{"source_language":"kmr","target_language":"en","message":"Em şîretan li kesên ku rastî tundiya rastgir, nîjadperestî û nemirovane hatine. Sedem dikarin cihêreng bin: esl, zayend, ol, seqetî, temen, statûya civakî, nasnameya zayendî an pabendbûna li dijî nîjadperestiyê."}' -H 'Content-Type: application/json'  | jq .  

Response:

{
  "translation": "We advise those who have been subjected to unjust, racist and inhumane violence. The reasons can be diverse: ethnicity, gender, religion, race, age, social status, gender identity or opposition to racism.",
  "target_language": "en",
  "status": "success"
}

Improve error handling

curl -v -s -X POST https://igchat-inference.tuerantuer.org/translate/message/ -d '{"source_language":"ab","target_language":"en","message":"irrelevant"}' -H 'Content-Type: application/json'  | jq .
{
  "status": "error",
  "reason": "'Language pair (ab, en) not supported by translation model'"
}

Missing

Use JSON response for language classification (see #170 )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant