thak123 commited on
Commit
8e9ca8a
·
1 Parent(s): 3e9b5c9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -30,8 +30,12 @@ def display_word():
30
  global current_index
31
  word_translation = word_translations[current_index]
32
  current_index = (current_index + 1) % len(word_translations)
33
- return f"Word: {word_translation['word']}<br>Translation: {word_translation['translation']} <iframe src='{item['link']}' width=\'100%\' height=\'500px\'></iframe>"
34
-
 
 
 
 
35
  # Create a Gradio interface
36
  iface = gr.Interface(
37
  fn=display_word,
 
30
  global current_index
31
  word_translation = word_translations[current_index]
32
  current_index = (current_index + 1) % len(word_translations)
33
+ display_html = f"Word: {word_translation['word']}<br>"
34
+ display_html += f"Translation: {word_translation['translation']}<br>"
35
+ display_html += f"<br><img src='{word_translation['image_url']}' width='200'><br>"
36
+ display_html += f"<br><iframe src='{word_translation['link']}' width=\'100%\' height=\'500px\'></iframe>"
37
+ return display_html
38
+
39
  # Create a Gradio interface
40
  iface = gr.Interface(
41
  fn=display_word,