HassanDataSci JagmeetMinhas22 commited on
Commit
f6d41de
·
verified ·
1 Parent(s): f284be9

Add in RAG component (#2)

Browse files

- Add in RAG component (00deebee76849d1311b645c01aab7f40b1d9bd0a)


Co-authored-by: Jagmeet Minhas <[email protected]>

Files changed (1) hide show
  1. app.py +7 -0
app.py CHANGED
@@ -3,6 +3,7 @@ from transformers import pipeline
3
  from PIL import Image
4
  from huggingface_hub import InferenceClient
5
  import os
 
6
 
7
  # Hugging Face API key
8
  API_KEY = st.secrets["HF_API_KEY"]
@@ -79,5 +80,11 @@ if uploaded_file is not None:
79
  except Exception as e:
80
  st.error(f"Error generating ingredients: {e}")
81
 
 
 
 
 
 
 
82
  # Footer
83
  st.sidebar.markdown("Developed by Muhammad Hassan Butt.")
 
3
  from PIL import Image
4
  from huggingface_hub import InferenceClient
5
  import os
6
+ from gradio_client import Client
7
 
8
  # Hugging Face API key
9
  API_KEY = st.secrets["HF_API_KEY"]
 
80
  except Exception as e:
81
  st.error(f"Error generating ingredients: {e}")
82
 
83
+ st.subheader("Healthier alternatives:")
84
+ try:
85
+ client = Client("https://4fbc334ff05ec351c8.gradio.live/")
86
+ result = client.predict(query=f"What's a healthy {top_food} recipe, and why is it healthy?", api_name="/get_response")
87
+ st.write(result)
88
+
89
  # Footer
90
  st.sidebar.markdown("Developed by Muhammad Hassan Butt.")