mirror of
https://github.com/modelscope/modelscope.git
synced 2025-12-16 16:27:45 +01:00
fix yapf
This commit is contained in:
@@ -51,14 +51,12 @@ class TranslationPipeline(Pipeline):
|
||||
|
||||
self._src_vocab_path = osp.join(
|
||||
model, self.cfg['dataset']['src_vocab']['file'])
|
||||
self._src_vocab = dict([
|
||||
(w.strip(), i) for i, w in enumerate(open(self._src_vocab_path, encoding='utf-8'))
|
||||
])
|
||||
self._src_vocab = dict([(w.strip(), i) for i, w in enumerate(
|
||||
open(self._src_vocab_path, encoding='utf-8'))])
|
||||
self._trg_vocab_path = osp.join(
|
||||
model, self.cfg['dataset']['trg_vocab']['file'])
|
||||
self._trg_rvocab = dict([
|
||||
(i, w.strip()) for i, w in enumerate(open(self._trg_vocab_path, encoding='utf-8'))
|
||||
])
|
||||
self._trg_rvocab = dict([(i, w.strip()) for i, w in enumerate(
|
||||
open(self._trg_vocab_path, encoding='utf-8'))])
|
||||
|
||||
tf_config = tf.ConfigProto(allow_soft_placement=True)
|
||||
tf_config.gpu_options.allow_growth = True
|
||||
|
||||
Reference in New Issue
Block a user