Skip to content

Commit 6c40d35

Browse files
lintian06copybara-github
authored andcommitted
Change the default vocab file name from 'vocab' to 'vocab.txt', if vocab flag is specified.
PiperOrigin-RevId: 361484017
1 parent cbe9642 commit 6c40d35

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

tensorflow_examples/lite/model_maker/core/task/custom_model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ def export(self,
126126
export_dir,
127127
tflite_filename='model.tflite',
128128
label_filename='labels.txt',
129-
vocab_filename='vocab',
129+
vocab_filename='vocab.txt',
130130
saved_model_filename='saved_model',
131131
tfjs_folder_name='tfjs',
132132
export_format=None,

tensorflow_examples/lite/model_maker/core/task/question_answer_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ def _test_f1_score(self, model, validation_data, threshold):
101101
self.assertGreaterEqual(metric['final_f1'], threshold)
102102

103103
def _test_export_vocab(self, model):
104-
vocab_output_file = os.path.join(self.get_temp_dir(), 'vocab')
104+
vocab_output_file = os.path.join(self.get_temp_dir(), 'vocab.txt')
105105
model.export(self.get_temp_dir(), export_format=ExportFormat.VOCAB)
106106

107107
self.assertTrue(os.path.isfile(vocab_output_file))

tensorflow_examples/lite/model_maker/core/task/text_classifier_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ def _test_export_labels(self, model):
170170
self.assertEqual(labels, ['neg', 'pos'])
171171

172172
def _test_export_vocab(self, model):
173-
vocab_output_file = os.path.join(self.get_temp_dir(), 'vocab')
173+
vocab_output_file = os.path.join(self.get_temp_dir(), 'vocab.txt')
174174
model.export(self.get_temp_dir(), export_format=ExportFormat.VOCAB)
175175

176176
word_index = self._load_vocab(vocab_output_file)

0 commit comments

Comments
 (0)