lyangas commited on
Commit
e1d5cdb
·
1 Parent(s): 2e06513

raise errors if cant load model

Browse files
Files changed (1) hide show
  1. app.py +4 -0
app.py CHANGED
@@ -18,6 +18,7 @@ try:
18
  print('INFO: embedder loaded')
19
  except Exception as e:
20
  print(f"ERROR: loading embedder failed with: {str(e)}")
 
21
 
22
  print('Loading classifiers of codes')
23
  classifiers_codes = {}
@@ -31,6 +32,7 @@ try:
31
  print(f'INFO: codes classifier {clf_name} loaded')
32
  except Exception as e:
33
  print(f"ERROR: loading classifiers failed with: {str(e)}")
 
34
 
35
  print('Loading classifiers of groups')
36
  classifiers_groups = {}
@@ -44,6 +46,7 @@ try:
44
  print(f'INFO: groups classifier {clf_name} loaded')
45
  except Exception as e:
46
  print(f"ERROR: loading classifiers failed with: {str(e)}")
 
47
 
48
  print('Loading classifiers in groups')
49
  groups_models = {}
@@ -58,6 +61,7 @@ try:
58
  print(f'INFO: codes classifier for group {group_name} loaded')
59
  except Exception as e:
60
  print(f"ERROR: loading classifiers failed with: {str(e)}")
 
61
 
62
 
63
  def classify_code(text, top_n):
 
18
  print('INFO: embedder loaded')
19
  except Exception as e:
20
  print(f"ERROR: loading embedder failed with: {str(e)}")
21
+ raise e
22
 
23
  print('Loading classifiers of codes')
24
  classifiers_codes = {}
 
32
  print(f'INFO: codes classifier {clf_name} loaded')
33
  except Exception as e:
34
  print(f"ERROR: loading classifiers failed with: {str(e)}")
35
+ raise e
36
 
37
  print('Loading classifiers of groups')
38
  classifiers_groups = {}
 
46
  print(f'INFO: groups classifier {clf_name} loaded')
47
  except Exception as e:
48
  print(f"ERROR: loading classifiers failed with: {str(e)}")
49
+ raise e
50
 
51
  print('Loading classifiers in groups')
52
  groups_models = {}
 
61
  print(f'INFO: codes classifier for group {group_name} loaded')
62
  except Exception as e:
63
  print(f"ERROR: loading classifiers failed with: {str(e)}")
64
+ raise e
65
 
66
 
67
  def classify_code(text, top_n):