-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path__init__.py
32 lines (23 loc) · 1003 Bytes
/
__init__.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
from .problems import TranslateManyToMany
#from tensorflow.distribute.cluster_resolver import TPUClusterResolver
#TPUClusterResolver.__init__.__defaults__ = ('tpu-1', 'europe-west4-a', 'neural-stuff-215413', 'worker', None, None, 'default', None, None)
#print(TPUClusterResolver.__init__.__defaults__)
#import json
#import tensorflow as tf
#with open("data_config_6to6.json") as fp:
# langs = json.load(fp)['languages']
#
#def encode(self, s, tgt_language="de"):
# inputs = self.real_encode(s)
# if tgt_language is not None:
# inputs.insert(0, 2 + langs.index(tgt_language))
# return inputs
#def modify_encoder():
# from tensor2tensor.bin.t2t_decoder import create_hparams
# hp = create_hparams()
# print(hp.problem_hparams.vocabulary['inputs'])
# raise
#modify_encoder()
#from tensor2tensor.data_generators import text_encoder
#text_encoder.SubwordTextEncoder.real_encode = text_encoder.SubwordTextEncoder.encode
#text_encoder.SubwordTextEncoder.encode = encode