Karim-Gamal commited on
Commit
58ff61a
Β·
1 Parent(s): b95f7c9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -254,8 +254,13 @@ def _method(text):
254
  text_to_emoji = {'red' : '❀', 'face': '😍', 'joy':'πŸ˜‚', 'love':'πŸ’•', 'fire':'πŸ”₯', 'smile':'😊', 'sunglasses':'😎', 'sparkle':'✨', 'blue':'πŸ’™', 'kiss':'😘', 'camera':'πŸ“·', 'USA':'πŸ‡ΊπŸ‡Έ', 'sun':'β˜€' , 'purple':'πŸ’œ', 'blink':'πŸ˜‰', 'hundred':'πŸ’―', 'beam':'😁', 'tree':'πŸŽ„', 'flash':'πŸ“Έ', 'tongue':'😜'}
255
 
256
  # Extract the dictionary from the list
257
- d = output_temp[0]
 
258
 
 
 
 
 
259
  # Extract the text from the 'generated_text' key
260
  text = d['generated_text']
261
 
 
254
  text_to_emoji = {'red' : '❀', 'face': '😍', 'joy':'πŸ˜‚', 'love':'πŸ’•', 'fire':'πŸ”₯', 'smile':'😊', 'sunglasses':'😎', 'sparkle':'✨', 'blue':'πŸ’™', 'kiss':'😘', 'camera':'πŸ“·', 'USA':'πŸ‡ΊπŸ‡Έ', 'sun':'β˜€' , 'purple':'πŸ’œ', 'blink':'πŸ˜‰', 'hundred':'πŸ’―', 'beam':'😁', 'tree':'πŸŽ„', 'flash':'πŸ“Έ', 'tongue':'😜'}
255
 
256
  # Extract the dictionary from the list
257
+ try:
258
+ d = output_temp[0]
259
 
260
+ except:
261
+ pass
262
+
263
+
264
  # Extract the text from the 'generated_text' key
265
  text = d['generated_text']
266