davidizzle commited on
Commit
8e1d1e9
·
1 Parent(s): 81ca012

Made GIF references external from GIPHY

Browse files
Files changed (1) hide show
  1. app.py +15 -3
app.py CHANGED
@@ -26,8 +26,12 @@ gif_html = st.empty()
26
  caption = st.empty()
27
 
28
  # Initially show still gem
 
 
 
 
29
  gif_html.markdown(
30
- f"<div style='text-align:center;'><img src='data:image/gif;base64,{still_gem_b64}' width='300'></div>",
31
  unsafe_allow_html=True,
32
  )
33
 
@@ -73,8 +77,12 @@ with col3:
73
 
74
  if st.button("Generate"):
75
  # Swap to rotating GIF
 
 
 
 
76
  gif_html.markdown(
77
- f"<div style='text-align:center;'><img src='data:image/gif;base64,{rotating_gem_b64}' width='300'></div>",
78
  unsafe_allow_html=True,
79
  )
80
  caption.markdown("<p style='text-align: center;'>Gemma is thinking... 🌀</p>", unsafe_allow_html=True)
@@ -87,8 +95,12 @@ if st.button("Generate"):
87
  outputs = model.generate(**inputs, max_new_tokens=max_tokens, temperature=temperature, top_p=top_p)
88
 
89
  # Back to still
 
 
 
 
90
  gif_html.markdown(
91
- f"<div style='text-align:center;'><img src='data:image/gif;base64,{still_gem_b64}' width='300'></div>",
92
  unsafe_allow_html=True,
93
  )
94
  caption.empty()
 
26
  caption = st.empty()
27
 
28
  # Initially show still gem
29
+ # gif_html.markdown(
30
+ # f"<div style='text-align:center;'><img src='data:image/gif;base64,{still_gem_b64}' width='300'></div>",
31
+ # unsafe_allow_html=True,
32
+ # )
33
  gif_html.markdown(
34
+ f"<div style='text-align:center;'><img src='https://media3.giphy.com/media/v1.Y2lkPTc5MGI3NjExMG00dmlwbjZsemZ5Mnh2eTIwOGNyYncwbGNqd3U3aHhiNGYxYjgwbCZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9cw/WmJtDY3xgYVgXgQZYc/giphy.gif' width='300'></div>",
35
  unsafe_allow_html=True,
36
  )
37
 
 
77
 
78
  if st.button("Generate"):
79
  # Swap to rotating GIF
80
+ # gif_html.markdown(
81
+ # f"<div style='text-align:center;'><img src='data:image/gif;base64,{rotating_gem_b64}' width='300'></div>",
82
+ # unsafe_allow_html=True,
83
+ # )
84
  gif_html.markdown(
85
+ f"<div style='text-align:center;'><img src='https://media4.giphy.com/media/v1.Y2lkPTc5MGI3NjExaXB0ZTEycW1yYWhvZWExdHFyNzBnemdtdm80NzY0MGg1ZnkyNTRqbiZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9cw/FIMRlbkylLyniVP7WG/giphy.gif' width='300'></div>",
86
  unsafe_allow_html=True,
87
  )
88
  caption.markdown("<p style='text-align: center;'>Gemma is thinking... 🌀</p>", unsafe_allow_html=True)
 
95
  outputs = model.generate(**inputs, max_new_tokens=max_tokens, temperature=temperature, top_p=top_p)
96
 
97
  # Back to still
98
+ # gif_html.markdown(
99
+ # f"<div style='text-align:center;'><img src='data:image/gif;base64,{still_gem_b64}' width='300'></div>",
100
+ # unsafe_allow_html=True,
101
+ # )
102
  gif_html.markdown(
103
+ f"<div style='text-align:center;'><img src='https://media3.giphy.com/media/v1.Y2lkPTc5MGI3NjExMG00dmlwbjZsemZ5Mnh2eTIwOGNyYncwbGNqd3U3aHhiNGYxYjgwbCZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9cw/WmJtDY3xgYVgXgQZYc/giphy.gif' width='300'></div>",
104
  unsafe_allow_html=True,
105
  )
106
  caption.empty()