nickmuchi commited on
Commit
93ccb6b
β€’
1 Parent(s): bcb8c1d

Update pages/2_Twitter_GPT_Search.py

Browse files
Files changed (1) hide show
  1. pages/2_Twitter_GPT_Search.py +5 -2
pages/2_Twitter_GPT_Search.py CHANGED
@@ -21,6 +21,9 @@ from langchain.schema import (
21
 
22
  from datetime import datetime as dt
23
 
 
 
 
24
  st.set_page_config(page_title="Tweets Question/Answering with Langchain and OpenAI", page_icon="πŸ”Ž")
25
 
26
  system_template="""Use the following pieces of context to answer the users question.
@@ -62,7 +65,7 @@ search_input = st.text_input(
62
 
63
  sbert_model_name = st.sidebar.selectbox("Embedding Model", options=list(bi_enc_dict.keys()), key='sbox')
64
 
65
- file = get_latest_file()
66
 
67
  try:
68
 
@@ -74,7 +77,7 @@ try:
74
  text=f"Loading {model} embedding model and Generating Response..."
75
  ):
76
 
77
- tweets = embed_tweets(file,model,search_input)
78
 
79
 
80
  references = [doc.page_content for doc in tweets['source_documents']]
 
21
 
22
  from datetime import datetime as dt
23
 
24
+ if 'tlist' not in st.session_state:
25
+ st.session_state['tlist'] = ''
26
+
27
  st.set_page_config(page_title="Tweets Question/Answering with Langchain and OpenAI", page_icon="πŸ”Ž")
28
 
29
  system_template="""Use the following pieces of context to answer the users question.
 
65
 
66
  sbert_model_name = st.sidebar.selectbox("Embedding Model", options=list(bi_enc_dict.keys()), key='sbox')
67
 
68
+ tweets = ','.join(st.session_state['tlist'])
69
 
70
  try:
71
 
 
77
  text=f"Loading {model} embedding model and Generating Response..."
78
  ):
79
 
80
+ tweets = embed_tweets(tweets,model,search_input)
81
 
82
 
83
  references = [doc.page_content for doc in tweets['source_documents']]