Spaces:
Sleeping
Sleeping
fix bug error before referencing
Browse files
app.py
CHANGED
@@ -10,7 +10,7 @@ import datetime as dt
|
|
10 |
import urllib.parse
|
11 |
|
12 |
|
13 |
-
st.set_page_config(page_title="
|
14 |
|
15 |
API_TOKEN = st.secrets['HF_TOKEN']
|
16 |
API_URL = "https://api-inference.huggingface.co/models/mistralai/Mixtral-8x7B-Instruct-v0.1"
|
@@ -240,21 +240,22 @@ def main():
|
|
240 |
|
241 |
# Add Google icon button to retrieve links
|
242 |
if st.button(f"Double-Check Response", key="google_button"):
|
243 |
-
search_query = get_search_query(st.session_state['generated'][-1])
|
244 |
-
retrieved_links = search_url(search_query)
|
245 |
-
|
246 |
for i in range(len(st.session_state['generated'])):
|
247 |
message(st.session_state['past'][i], is_user=True, key=str(i) + '_user', logo="https://i.pinimg.com/originals/d5/b2/13/d5b21384ccaaa6f9ef32986f17c50638.png")
|
248 |
message(st.session_state["generated"][i], key=str(i), logo= "https://emojiisland.com/cdn/shop/products/Robot_Emoji_Icon_7070a254-26f7-4a54-8131-560e38e34c2e_large.png?v=1571606114")
|
249 |
|
|
|
|
|
|
|
|
|
250 |
if retrieved_links:
|
251 |
st.markdown("**Google Search Results:**")
|
252 |
for j, link in enumerate(retrieved_links):
|
|
|
|
|
253 |
st.markdown(f"{j + 1}. [{link['title']}]({link['link']})")
|
254 |
|
255 |
-
|
256 |
-
st.image(google_logo_url, width=15, caption="Google Logo")
|
257 |
-
google_logo_url = "https://companieslogo.com/img/orig/GOOG-0ed88f7c.png"
|
258 |
|
259 |
if __name__ == "__main__":
|
260 |
main()
|
|
|
10 |
import urllib.parse
|
11 |
|
12 |
|
13 |
+
st.set_page_config(page_title="Smart Fellah - سمارت فلاح 🌱")
|
14 |
|
15 |
API_TOKEN = st.secrets['HF_TOKEN']
|
16 |
API_URL = "https://api-inference.huggingface.co/models/mistralai/Mixtral-8x7B-Instruct-v0.1"
|
|
|
240 |
|
241 |
# Add Google icon button to retrieve links
|
242 |
if st.button(f"Double-Check Response", key="google_button"):
|
|
|
|
|
|
|
243 |
for i in range(len(st.session_state['generated'])):
|
244 |
message(st.session_state['past'][i], is_user=True, key=str(i) + '_user', logo="https://i.pinimg.com/originals/d5/b2/13/d5b21384ccaaa6f9ef32986f17c50638.png")
|
245 |
message(st.session_state["generated"][i], key=str(i), logo= "https://emojiisland.com/cdn/shop/products/Robot_Emoji_Icon_7070a254-26f7-4a54-8131-560e38e34c2e_large.png?v=1571606114")
|
246 |
|
247 |
+
search_query = get_search_query(st.session_state['generated'][-1])
|
248 |
+
retrieved_links = search_url(search_query)
|
249 |
+
|
250 |
+
|
251 |
if retrieved_links:
|
252 |
st.markdown("**Google Search Results:**")
|
253 |
for j, link in enumerate(retrieved_links):
|
254 |
+
# Display Google logo
|
255 |
+
st.image("https://companieslogo.com/img/orig/GOOG-0ed88f7c.png", width=15, caption="Google Logo")
|
256 |
st.markdown(f"{j + 1}. [{link['title']}]({link['link']})")
|
257 |
|
258 |
+
|
|
|
|
|
259 |
|
260 |
if __name__ == "__main__":
|
261 |
main()
|