No description
- Python 92.5%
- Dockerfile 7.5%
| .dockerignore | ||
| .gitignore | ||
| docker-compose.yml | ||
| Dockerfile | ||
| readme.md | ||
| requirements.txt | ||
| server.py | ||
| test.py | ||
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.