Mbonea commited on
Commit
78d4065
1 Parent(s): ffa2a35

remove logging and exception handling

Browse files
Files changed (2) hide show
  1. App/Embedding/utils/Initialize.py +5 -1
  2. App/app.py +5 -5
App/Embedding/utils/Initialize.py CHANGED
@@ -33,7 +33,11 @@ def generate_text(doc):
33
 
34
  def IdSearch(query:str):
35
  doc=requests.get(f'https://api.themoviedb.org/3/find/{query}?external_source=imdb_id&language=en&api_key={TMDB_API}').json()
36
- text,_=generate_text(doc)
 
 
 
 
37
  return TextSearch(text,filter={"key": {"$ne":query}})
38
 
39
 
 
33
 
34
  def IdSearch(query:str):
35
  doc=requests.get(f'https://api.themoviedb.org/3/find/{query}?external_source=imdb_id&language=en&api_key={TMDB_API}').json()
36
+ try:
37
+ text,props=generate_text(doc)
38
+ except Exception as e:
39
+ print(e)
40
+ return []
41
  return TextSearch(text,filter={"key": {"$ne":query}})
42
 
43
 
App/app.py CHANGED
@@ -13,11 +13,11 @@ import logging
13
 
14
 
15
  # Configure logging
16
- logging.basicConfig(
17
- level=logging.DEBUG,
18
- format="%(asctime)s - %(levelname)s - %(message)s",
19
- datefmt="%Y-%m-%d %H:%M:%S",
20
- )
21
 
22
 
23
  app = FastAPI()
 
13
 
14
 
15
  # Configure logging
16
+ # logging.basicConfig(
17
+ # level=logging.DEBUG,
18
+ # format="%(asctime)s - %(levelname)s - %(message)s",
19
+ # datefmt="%Y-%m-%d %H:%M:%S",
20
+ # )
21
 
22
 
23
  app = FastAPI()