Views
No views yet
1pip install --upgrade pip # ensures that pip is current
2pip install unbabel-comet
3
4from comet import download_model, load_from_checkpoint
5
6model_path = download_model("anon0616/wmt21-comet-qe-mqm")
7model = load_from_checkpoint(model_path)
8data = [
9 {
10 "src": "Dem Feuer konnte Einhalt geboten werden",
11 "mt": "The fire could be stopped",
12 "ref": "They were able to control the fire."
13 },
14 {
15 "src": "Schulen und Kindergärten wurden eröffnet.",
16 "mt": "Schools and kindergartens were open",
17 "ref": "Schools and kindergartens opened"
18 }
19]
20model_output = model.predict(data, batch_size=8, gpus=1)
21print (model_output)