arjunbansal commited on
Commit
dc76948
1 Parent(s): ab5fc7c

add log10_session scope

Browse files
Files changed (2) hide show
  1. app.py +6 -2
  2. requirements.txt +1 -0
app.py CHANGED
@@ -1,5 +1,5 @@
1
  import streamlit as st
2
- from log10.load import log10
3
  import openai
4
 
5
  @st.cache_resource
@@ -36,6 +36,10 @@ index = init_vector_db();
36
 
37
  st.title('State of the Union')
38
  query = st.text_input("Question:", "What did the president say about Ketanji Brown Jackson?")
39
- answer = index.query_with_sources(query, llm=ChatOpenAI(temperature=0, model_name="gpt-3.5-turbo"))
 
 
 
 
40
 
41
  st.write(answer)
 
1
  import streamlit as st
2
+ from log10.load import log10, log10_session
3
  import openai
4
 
5
  @st.cache_resource
 
36
 
37
  st.title('State of the Union')
38
  query = st.text_input("Question:", "What did the president say about Ketanji Brown Jackson?")
39
+ #answer = index.query_with_sources(query, llm=ChatOpenAI(temperature=0, model_name="gpt-3.5-turbo"))
40
+
41
+ # If you want to combine all queries into a single session can comment the 2 lines below and uncomment the answer=... line above
42
+ with log10_session():
43
+ answer = index.query_with_sources(query, llm=ChatOpenAI(temperature=0, model_name="gpt-3.5-turbo"))
44
 
45
  st.write(answer)
requirements.txt CHANGED
@@ -1,4 +1,5 @@
1
  chromadb
 
2
  streamlit
3
  langchain
4
  openai
 
1
  chromadb
2
+ tiktoken
3
  streamlit
4
  langchain
5
  openai