Comments (1)
The docker image for this experiment is ghcr.io/opennmt/opennmt-py:3.4.3-ubuntu22.04-cuda11.8
but the PYTHONPATH
refers to the commit 0436cdd.
We encountered an error at the loading of a checkpoint when trying to infer from a file with the inference engine (so the issue is not specifically related to LM prior).
from onmt.inference_engine import InferenceEnginePY
import json
import time
import onmt.opts as opts
from onmt.utils.parse import ArgumentParser
from onmt.utils.misc import use_gpu, set_random_seed
def _get_parser():
parser = ArgumentParser(description="simple_inference_engine_py.py")
opts.config_opts(parser)
opts.translate_opts(parser, dynamic=True)
return parser
def main():
# Required arguments
parser = ArgumentParser()
parser.add_argument(
"-inference_config_file", help="Inference config file", required=True, type=str
)
args = parser.parse_args()
inference_config_file = args.inference_config_file
base_args = ["-config", inference_config_file]
parser = _get_parser()
opt = parser.parse_args(base_args)
ArgumentParser.validate_translate_opts(opt)
ArgumentParser._get_all_transform_translate(opt)
ArgumentParser._validate_transforms_opts(opt)
ArgumentParser.validate_translate_opts_dynamic(opt)
set_random_seed(opt.seed, use_gpu(opt))
opt.model_task = 'seq2seq'
engine = InferenceEnginePY(opt)
scores, preds = engine.infer_file()
print(list(zip(scores, preds)))
engine.terminate()
if __name__ == "__main__":
main()
from opennmt-py.
Related Issues (20)
- transforms: filtertoolong failed in translating HOT 1
- bash: scripts/onmt/train.sh: No such file or directory HOT 4
- Cannot load recurrent encoder-decoder model trained with copy attention HOT 7
- Columns and DataType Not Explicitly Set on line 163 of run_mmlu_opennmt.py
- Training fails to start with rotary embedding (Latest OpenNMT-py) HOT 3
- NCCL timeout with 2B+ parameter model HOT 8
- set random seed for a multi-GPU model HOT 1
- Data generation when resuming from a checkpoint HOT 2
- Input size mismatch HOT 1
- Error message of `SequenceTooLongError` HOT 1
- Bug when training encoder-decoder models HOT 1
- Supported SentencePiece parameters HOT 1
- List index out of range in onmt.utils.distributed.all_reduce_and_rescale_tensors:51
- Speech to Text Toy Data Could Not Be Downloaded HOT 3
- Translation API Not Working HOT 1
- How to use Huawei‘s NPU Ascend310 to install OpenNMT-py? HOT 1
- NaN values when training big transformer model HOT 1
- Support for torch 2.2 HOT 5
- Device side assert triggered on AWQ Mistral converted model HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from opennmt-py.