mirror of
https://github.com/wassname/stampy-chat.git
synced 2026-09-10 12:40:44 +08:00
fix logging times
This commit is contained in:
+1
-1
@@ -154,7 +154,7 @@ def talk_to_robot_internal(index, query: str, history: List[Dict[str, str]], k:
|
||||
|
||||
|
||||
t2 = time.time()
|
||||
print("Time to get response: ", t2 - t1, " s")
|
||||
print(f'Time to get response: {t2-t1:.2f}s')
|
||||
|
||||
if DEBUG_PRINT:
|
||||
print('\n' * 10)
|
||||
|
||||
+2
-2
@@ -76,7 +76,7 @@ def get_top_k_blocks(index, user_query: str, k: int) -> List[Block]:
|
||||
query_embedding = get_embedding(user_query)
|
||||
|
||||
t1 = time.time()
|
||||
print("Time to get embedding: ", t1 - t)
|
||||
print(f'Time to get embedding: {t1-t:.2f}s')
|
||||
|
||||
query_response = index.query(
|
||||
namespace="alignment-search", # ugly, sorry
|
||||
@@ -103,7 +103,7 @@ def get_top_k_blocks(index, user_query: str, k: int) -> List[Block]:
|
||||
|
||||
t2 = time.time()
|
||||
|
||||
print("Time to get top-k blocks: ", t2 - t1)
|
||||
print(f'Time to get top-k blocks: {t2-t1:.2f}s')
|
||||
|
||||
# for all blocks that are "the same" (same title, author, date, url, tags),
|
||||
# combine their text with "....." in between. Return them in order such
|
||||
|
||||
Reference in New Issue
Block a user