LevGervich commited on
Commit
63fede5
1 Parent(s): 54c6c21

Fix imports

Browse files
backend/semantic_search.py CHANGED
@@ -6,7 +6,21 @@ import gradio as gr
6
  from sentence_transformers import SentenceTransformer
7
  from FlagEmbedding import FlagReranker
8
 
9
- from utils.time_decorator import timeit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
 
11
  db = lancedb.connect(".lancedb")
12
 
 
6
  from sentence_transformers import SentenceTransformer
7
  from FlagEmbedding import FlagReranker
8
 
9
+ from functools import wraps
10
+ import time
11
+
12
+
13
+ def timeit(func):
14
+ @wraps(func)
15
+ def timeit_wrapper(*args, **kwargs):
16
+ start_time = time.perf_counter()
17
+ result = func(*args, **kwargs)
18
+ end_time = time.perf_counter()
19
+ total_time = end_time - start_time
20
+ print(f'Function {func.__name__}{args} {kwargs} Took {total_time:.4f} seconds')
21
+ return result
22
+ return timeit_wrapper
23
+
24
 
25
  db = lancedb.connect(".lancedb")
26
 
backend/utils/time_decorator.py DELETED
@@ -1,14 +0,0 @@
1
- from functools import wraps
2
- import time
3
-
4
-
5
- def timeit(func):
6
- @wraps(func)
7
- def timeit_wrapper(*args, **kwargs):
8
- start_time = time.perf_counter()
9
- result = func(*args, **kwargs)
10
- end_time = time.perf_counter()
11
- total_time = end_time - start_time
12
- print(f'Function {func.__name__}{args} {kwargs} Took {total_time:.4f} seconds')
13
- return result
14
- return timeit_wrapper