Spaces:
Runtime error
Runtime error
Commit
·
6cf1d09
1
Parent(s):
c50d017
Update app.py
Browse files
app.py
CHANGED
@@ -5,6 +5,7 @@ import numpy as np
|
|
5 |
import pinecone
|
6 |
from sentence_transformers import SentenceTransformer
|
7 |
from concurrent.futures import ThreadPoolExecutor
|
|
|
8 |
|
9 |
pinecone.init(api_key='f5112f8c-f27d-4af1-b427-0c0953c113b5', environment='asia-southeast1-gcp')
|
10 |
|
@@ -52,6 +53,7 @@ def main():
|
|
52 |
json_input = st.text_area("")
|
53 |
|
54 |
if st.button("Process"):
|
|
|
55 |
with st.spinner("Processing..."):
|
56 |
try:
|
57 |
input_data = json.loads(json_input)
|
@@ -67,5 +69,8 @@ def main():
|
|
67 |
except json.JSONDecodeError:
|
68 |
st.error("Invalid JSON input. Please check and try again.")
|
69 |
|
|
|
|
|
|
|
70 |
if __name__ == "__main__":
|
71 |
main()
|
|
|
5 |
import pinecone
|
6 |
from sentence_transformers import SentenceTransformer
|
7 |
from concurrent.futures import ThreadPoolExecutor
|
8 |
+
import time
|
9 |
|
10 |
pinecone.init(api_key='f5112f8c-f27d-4af1-b427-0c0953c113b5', environment='asia-southeast1-gcp')
|
11 |
|
|
|
53 |
json_input = st.text_area("")
|
54 |
|
55 |
if st.button("Process"):
|
56 |
+
start_time = time.time()
|
57 |
with st.spinner("Processing..."):
|
58 |
try:
|
59 |
input_data = json.loads(json_input)
|
|
|
69 |
except json.JSONDecodeError:
|
70 |
st.error("Invalid JSON input. Please check and try again.")
|
71 |
|
72 |
+
end_time = time.time()
|
73 |
+
st.write(f"Processing time: {end_time - start_time:.2f} seconds")
|
74 |
+
|
75 |
if __name__ == "__main__":
|
76 |
main()
|