PierreHanna commited on
Commit
0c1bb10
1 Parent(s): 2b3113b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -6
app.py CHANGED
@@ -33,6 +33,13 @@ from models import *
33
  max_results = 100
34
  max_output = 50
35
 
 
 
 
 
 
 
 
36
 
37
  def download_audio_(link):
38
  file_name = f"{uuid.uuid4()}.mp3"
@@ -71,12 +78,8 @@ def process(file_name, embed_html_all):
71
  except:
72
  print(traceback.format_exc())
73
 
74
- ind = get_index()
75
- ind_filenames = get_audio_names()
76
- catalog = get_catalog()
77
- url_dict = get_durl_myma()
78
- dict_catalog = get_dict_catalog()
79
-
80
  timestart = time.time()
81
  _, I = do_search(emb, ind)
82
  print("search time :", time.time() - timestart)
 
33
  max_results = 100
34
  max_output = 50
35
 
36
+ # global (faster)
37
+ ind = get_index()
38
+ ind_filenames = get_audio_names()
39
+ catalog = get_catalog()
40
+ url_dict = get_durl_myma()
41
+ dict_catalog = get_dict_catalog()
42
+
43
 
44
  def download_audio_(link):
45
  file_name = f"{uuid.uuid4()}.mp3"
 
78
  except:
79
  print(traceback.format_exc())
80
 
81
+ # => global
82
+
 
 
 
 
83
  timestart = time.time()
84
  _, I = do_search(emb, ind)
85
  print("search time :", time.time() - timestart)