Spaces:
Runtime error
Runtime error
Commit
·
8b34c0b
1
Parent(s):
f1cb8b4
Update app.py
Browse files
app.py
CHANGED
@@ -23,9 +23,7 @@ pinecone.init(
|
|
23 |
)
|
24 |
|
25 |
index_name = PINECONE_INDEX
|
26 |
-
start_time = time.time()
|
27 |
vectorstore = Pinecone.from_existing_index(index_name=index_name, embedding=embeddings)
|
28 |
-
print("---vectorstore %s seconds ---" % (time.time() - start_time))
|
29 |
|
30 |
chain = get_chain(vectorstore)
|
31 |
|
@@ -51,8 +49,11 @@ class ChatWrapper:
|
|
51 |
import openai
|
52 |
openai.api_key = os.getenv("OPENAI_API_KEY")
|
53 |
# Run chain and append input.
|
|
|
54 |
output = chain({"question": inp, "chat_history": history})["answer"]
|
|
|
55 |
history.append((inp, output))
|
|
|
56 |
except Exception as e:
|
57 |
raise e
|
58 |
finally:
|
|
|
23 |
)
|
24 |
|
25 |
index_name = PINECONE_INDEX
|
|
|
26 |
vectorstore = Pinecone.from_existing_index(index_name=index_name, embedding=embeddings)
|
|
|
27 |
|
28 |
chain = get_chain(vectorstore)
|
29 |
|
|
|
49 |
import openai
|
50 |
openai.api_key = os.getenv("OPENAI_API_KEY")
|
51 |
# Run chain and append input.
|
52 |
+
start_time = time.time()
|
53 |
output = chain({"question": inp, "chat_history": history})["answer"]
|
54 |
+
print("---chain %s seconds ---" % (time.time() - start_time))
|
55 |
history.append((inp, output))
|
56 |
+
print("---history %s seconds ---" % (time.time() - start_time))
|
57 |
except Exception as e:
|
58 |
raise e
|
59 |
finally:
|