Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -212,7 +212,7 @@ def split_text_into_chunks(text):
|
|
212 |
return text_splitter.split_text(text)
|
213 |
|
214 |
def create_vector_store_from_text_chunks(text_chunks):
|
215 |
-
key = os.getenv('
|
216 |
embeddings = OpenAIEmbeddings(openai_api_key=key)
|
217 |
return FAISS.from_texts(texts=text_chunks, embedding=embeddings)
|
218 |
|
@@ -238,7 +238,7 @@ def process_user_input(user_question):
|
|
238 |
|
239 |
def main():
|
240 |
# Sidebar and global
|
241 |
-
openai.api_key = os.getenv('
|
242 |
st.set_page_config(page_title="GPT Streamlit Document Reasoner",layout="wide")
|
243 |
menu = ["htm", "txt", "xlsx", "csv", "md", "py"] #619
|
244 |
choice = st.sidebar.selectbox("Output File Type:", menu)
|
|
|
212 |
return text_splitter.split_text(text)
|
213 |
|
214 |
def create_vector_store_from_text_chunks(text_chunks):
|
215 |
+
key = os.getenv('OPENAI_API_KEY')
|
216 |
embeddings = OpenAIEmbeddings(openai_api_key=key)
|
217 |
return FAISS.from_texts(texts=text_chunks, embedding=embeddings)
|
218 |
|
|
|
238 |
|
239 |
def main():
|
240 |
# Sidebar and global
|
241 |
+
openai.api_key = os.getenv('OPENAI_API_KEY')
|
242 |
st.set_page_config(page_title="GPT Streamlit Document Reasoner",layout="wide")
|
243 |
menu = ["htm", "txt", "xlsx", "csv", "md", "py"] #619
|
244 |
choice = st.sidebar.selectbox("Output File Type:", menu)
|