vishnun commited on
Commit
023adc5
1 Parent(s): 8ae5128

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -2,15 +2,15 @@ import re
2
  import streamlit as st
3
  from PyBingScrapper.search import BingSearch
4
 
5
- query = st.text_input("Enter the query you want to search for:,{PS: please enter the search term in brackets []}")
 
 
 
6
  submit_button = st.button("Submit")
7
- r = "\[(.*?)\]"
8
- re_list = re.findall(r, query)
9
- q_input = (' ').join(re_list)
10
  hf_token = st.secrets["HF_TOKEN"]
11
 
12
  if submit_button:
13
- bingsearch = BingSearch(q_input)
14
  b_res = bingsearch.get_results(num=5, max_lines=3)
15
  st.info(bingsearch.rag_output(query, b_res, hf_token, 15))
16
 
 
2
  import streamlit as st
3
  from PyBingScrapper.search import BingSearch
4
 
5
+ st.title("Bing - RAG")
6
+ st.subheader('Implementation of RAG over search results bing search', divider='rainbow')
7
+ query = st.text_input("Enter the query you want to search for:")
8
+ st.caption("Example: Why is there a huge conflict between India and Pakistan?")
9
  submit_button = st.button("Submit")
 
 
 
10
  hf_token = st.secrets["HF_TOKEN"]
11
 
12
  if submit_button:
13
+ bingsearch = BingSearch(query)
14
  b_res = bingsearch.get_results(num=5, max_lines=3)
15
  st.info(bingsearch.rag_output(query, b_res, hf_token, 15))
16