felix commited on
Commit
1b030ef
1 Parent(s): e98a91e
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -157,8 +157,11 @@ def is_valid_unicode(char):
157
  return False # Invalid Unicode character
158
 
159
  def remove_invalid_unicode(input_string):
160
- valid_chars = [char for char in input_string if is_valid_unicode(char)]
161
- return ''.join(valid_chars)
 
 
 
162
 
163
  dummy1 = gr.Textbox(visible=False)
164
 
 
157
  return False # Invalid Unicode character
158
 
159
  def remove_invalid_unicode(input_string):
160
+ if isinstance(input_string, str):
161
+ valid_chars = [char for char in input_string if is_valid_unicode(char)]
162
+ return ''.join(valid_chars)
163
+ else:
164
+ return input_string # Return non-string values as is
165
 
166
  dummy1 = gr.Textbox(visible=False)
167