No description
  • Python 92.5%
  • Dockerfile 7.5%
Find a file
2026-10-13 11:03:47 +01:00
.dockerignore Initial commit 2026-10-12 21:45:40 +01:00
.gitignore Initial commit 2026-10-12 21:45:40 +01:00
docker-compose.yml Initial commit 2026-10-12 21:45:40 +01:00
Dockerfile Initial commit 2026-10-12 21:45:40 +01:00
readme.md solved misinformation 2026-10-13 11:03:47 +01:00
requirements.txt Initial commit 2026-10-12 21:45:40 +01:00
server.py Initial commit 2026-10-12 21:45:40 +01:00
test.py Initial commit 2026-10-12 21:45:40 +01:00

Croeso i Cyfiaithu!

repo syml sy'n taflu modelau cyfiaithu Techiaith i mewn i cynhwysydd Docker.

Rhedwch gyda docker-compose up --build

Mae'n cynnal endpoint "post" ar 127.0.0.1:8000 sy'n defnyddio'r schema:

{
    "model_name": # un o "en-cy-legislation" "en-cy-health" "cy-en-1"
    "texts": ["Translate this please", "and this too"]
}

Mae gen i sgript hefyd:

cytranslate() {
  local input="$1" model="${2:-en-cy-legislation}" query

  if [ -f "$input" ]; then
    query=$(jq -Rs --arg m "$model" \
      'split("\n") | map(select(length > 0)) | {model_name: $m, texts: .}' "$input")
  else
    query=$(jq -n --arg m "$model" --arg txt "$input" \
      '{model_name: $m, texts: [$txt]}')
  fi

  curl -s -X POST http://127.0.0.1:8000/translate \
    -H "Content-Type: application/json" -d "$query" | jq -r '.translations[]?'
}

I defnyddio fel cytranslate "hynnu os gwelwch yn dda" (model-name)

Mae croeso i chi anfon neges ataf.

Welcome to Cyfiaithu

A simple repo that chucks Techiaith's translation models into a Docker container.

Run with docker-compose up --build

It has the "post" endpoint at 127.0.0.1:8000 using the schema seen above.

You can also see my quick script to connect to it.

Feel free to message me wrt the repo.