Download mosesdecoder/contrib/server/update.py from suricodes/hindi-sindhi-docker: direct link, hf CLI and curl.
- Browser
- Download file 565 Bytes
-
https://huggingface.co/spaces/suricodes/hindi-sindhi-docker/resolve/main/mosesdecoder/contrib/server/update.py
- Command line
-
hf download hf://spaces/suricodes/hindi-sindhi-docker/mosesdecoder/contrib/server/update.py
-
curl -L -o update.py https://huggingface.co/spaces/suricodes/hindi-sindhi-docker/resolve/main/mosesdecoder/contrib/server/update.py
565 Bytes
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| # update the suffix-array phrasetable via XMLRPC | |
| import xmlrpclib | |
| import datetime | |
| url = "http://localhost:8080/RPC2" | |
| proxy = xmlrpclib.ServerProxy(url) | |
| text = u"il a souhaité que la présidence trace à nice le chemin pour l' avenir ." | |
| source = "Mein kleines Puppenhaus ." | |
| target = "My small doll house ." | |
| #align = "1-1 2-2 3-3 3-4 5-4" | |
| align = "0-0 1-1 2-2 2-3 3-4" | |
| params = {"source":source, "target":target, "alignment":align} | |
| print "Updating with %s ..." %params | |
| result = proxy.updater(params) | |
| print result | |