anuragshas commited on
Commit
9d1a20d
1 Parent(s): afc2b20

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -86,6 +86,8 @@ def decode_sequence(input_seq):
86
 
87
 
88
  def translate(input_text):
 
 
89
  encoder_input_data = np.zeros(
90
  (1, max_encoder_seq_length, num_encoder_tokens), dtype="float32"
91
  )
 
86
 
87
 
88
  def translate(input_text):
89
+ if len(input_text) > max_encoder_seq_length:
90
+ input_text = input_text[:max_encoder_seq_length]
91
  encoder_input_data = np.zeros(
92
  (1, max_encoder_seq_length, num_encoder_tokens), dtype="float32"
93
  )