ecepekaslan commited on
Commit
7b801be
·
1 Parent(s): 1fd7e32

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -6
app.py CHANGED
@@ -10,10 +10,10 @@ from langchain.vectorstores import FAISS
10
  import tempfile
11
 
12
 
13
- user_api_key = st.sidebar.text_input(
14
- label="#### Your OpenAI API key 👇",
15
- placeholder="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",
16
- type="password")
17
 
18
 
19
  uploaded_file = st.sidebar.file_uploader("upload", type="csv")
@@ -29,7 +29,7 @@ if uploaded_file :
29
  embeddings = OpenAIEmbeddings()
30
  vectors = FAISS.from_documents(data, embeddings)
31
 
32
- chain = ConversationalRetrievalChain.from_llm(llm = ChatOpenAI(temperature=0.0,model_name='gpt-3.5-turbo', openai_api_key=user_api_key),
33
  retriever=vectors.as_retriever())
34
 
35
  def conversational_chat(query):
@@ -71,4 +71,3 @@ if uploaded_file :
71
  message(st.session_state["past"][i], is_user=True, key=str(i) + '_user', avatar_style="big-smile")
72
  message(st.session_state["generated"][i], key=str(i), avatar_style="thumbs")
73
 
74
- #streamlit run tuto_chatbot_csv.py
 
10
  import tempfile
11
 
12
 
13
+ ####user_api_key = st.sidebar.text_input(
14
+ #### label="#### Your OpenAI API key 👇",
15
+ #### placeholder="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",
16
+ #### type="password")
17
 
18
 
19
  uploaded_file = st.sidebar.file_uploader("upload", type="csv")
 
29
  embeddings = OpenAIEmbeddings()
30
  vectors = FAISS.from_documents(data, embeddings)
31
 
32
+ chain = ConversationalRetrievalChain.from_llm(llm = ChatOpenAI(temperature=0.0,model_name='gpt-3.5-turbo'),
33
  retriever=vectors.as_retriever())
34
 
35
  def conversational_chat(query):
 
71
  message(st.session_state["past"][i], is_user=True, key=str(i) + '_user', avatar_style="big-smile")
72
  message(st.session_state["generated"][i], key=str(i), avatar_style="thumbs")
73