Skip to content

Commit

Permalink
Fix bug by changes in Big Vision.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 588003859
  • Loading branch information
jpuigcerver authored and copybara-github committed Dec 5, 2023
1 parent 7386d27 commit dfb9ee0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions vmoe/data/pp_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,9 +380,9 @@ def tokenize(
pad_value = tokenizer.string_to_id(pad_value)

def _pp_tokenize(txt):
if sample_if_multi:
txt = bv_ops_text.ops_general.get_choice(
empty_fallback='', key='t')({'t': txt})['t']
if sample_if_multi and tf.convert_to_tensor(txt).ndim:
txt = bv_ops_text.ops_general.get_choice(key='t')(
bv_ops_text.ops_general.get_setdefault('t', '')({'t': txt}))['t']

if lower:
txt = tf.strings.lower(txt) if sample_if_multi else tf.map_fn(
Expand Down

0 comments on commit dfb9ee0

Please sign in to comment.