Kaludi commited on
Commit
cf09c17
1 Parent(s): 2ddade0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -3
app.py CHANGED
@@ -11,6 +11,11 @@ from transformers import AutoModelForImageClassification
11
  import plotly.graph_objects as go
12
  import plotly
13
  import re
 
 
 
 
 
14
 
15
  st.set_page_config(layout='wide',
16
  page_title='Food Category Classification & Recipes'
@@ -326,9 +331,11 @@ def main():
326
  st.markdown("### Macronutrients Pie Chart ;) (In Grams)")
327
  st.plotly_chart(fig)
328
  st.write("**Tags:** ", random_recipe['Tags'])
329
- st.write("**Recipe URL:** ", random_recipe['Recipe URLs'])
 
330
  st.markdown("### JSON Response:")
331
- st.write(response_json)
 
332
  else:
333
  st.markdown("### Recommended Recipe:")
334
  st.write("**Title:** ", response_json[0]['Title'])
@@ -486,7 +493,8 @@ def main():
486
  st.markdown("### Macronutrients Pie Chart ;) (In Grams)")
487
  st.plotly_chart(fig)
488
  st.write("**Tags:** ", response_json[0]['Tags'])
489
- st.write("**Recipe URL:** ", response_json[0]['Recipe URLs'])
 
490
  st.markdown("### JSON Response:")
491
  st.write(response_json)
492
 
 
11
  import plotly.graph_objects as go
12
  import plotly
13
  import re
14
+ import io
15
+ from fpdf import FPDF
16
+ import base64
17
+ from fpdf import FPDF, HTMLMixin
18
+
19
 
20
  st.set_page_config(layout='wide',
21
  page_title='Food Category Classification & Recipes'
 
331
  st.markdown("### Macronutrients Pie Chart ;) (In Grams)")
332
  st.plotly_chart(fig)
333
  st.write("**Tags:** ", random_recipe['Tags'])
334
+ st.write("**Recipe URL:** ", random_recipe['Recipe URLs'])
335
+ st.write("*To download this recipe as a PDF, open the hamburger menu on the top right and click on Print.*")
336
  st.markdown("### JSON Response:")
337
+ st.write(response_json)
338
+
339
  else:
340
  st.markdown("### Recommended Recipe:")
341
  st.write("**Title:** ", response_json[0]['Title'])
 
493
  st.markdown("### Macronutrients Pie Chart ;) (In Grams)")
494
  st.plotly_chart(fig)
495
  st.write("**Tags:** ", response_json[0]['Tags'])
496
+ st.write("**Recipe URL:** ", response_json[0]['Recipe URLs'])
497
+ st.write("*To download this recipe as a PDF, open the hamburger menu on the top right and click on Print.*")
498
  st.markdown("### JSON Response:")
499
  st.write(response_json)
500