Skip to content

Commit

Permalink
Merge pull request #51 from StampyAI/logging-time-fix
Browse files Browse the repository at this point in the history
fix logging times
  • Loading branch information
FraserLee committed Jul 8, 2023
2 parents 8e99e56 + b292e76 commit b263b59
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion api/chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions api/get_blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit b263b59

Please sign in to comment.