hprasath commited on
Commit
402e851
·
verified ·
1 Parent(s): 061093f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -18,6 +18,8 @@ from utils.imageEmbedding.index import get_image_embedding
18
  from utils.similarityScore import get_all_similarities
19
  from utils.objectDetection.index import detect_objects
20
 
 
 
21
  app = Flask(__name__)
22
  cache = Cache(app, config={'CACHE_TYPE': 'simple'}) # You can choose a caching type based on your requirements
23
  CORS(app)
@@ -241,7 +243,7 @@ def get_video_embedding_route():
241
  try:
242
  audio_embedding = extract_audio_embeddings(audio_data)
243
  except Exception as e:
244
- return jsonify({"error": "Failed to extract audio embeddings 2"}), 500
245
  audio_embedding_list = audio_embedding
246
  try :
247
  audio_file = io.BytesIO(audio_data)
@@ -272,7 +274,7 @@ def extract_pdf_text_and_embedding():
272
  try:
273
  pdf_url = request.json.get("pdfUrl")
274
  print(1)
275
- pages_info
276
  try :
277
  pages_info = seperate_image_text_from_pdf(pdf_url)
278
  except Exception as e:
@@ -354,3 +356,4 @@ def get_similarity_score_route():
354
 
355
  except Exception as e:
356
  return jsonify({"error": str(e)}), 500
 
 
18
  from utils.similarityScore import get_all_similarities
19
  from utils.objectDetection.index import detect_objects
20
 
21
+
22
+
23
  app = Flask(__name__)
24
  cache = Cache(app, config={'CACHE_TYPE': 'simple'}) # You can choose a caching type based on your requirements
25
  CORS(app)
 
243
  try:
244
  audio_embedding = extract_audio_embeddings(audio_data)
245
  except Exception as e:
246
+ return jsonify({"error": "Failed to extract audio embeddings 2 "+e}), 500
247
  audio_embedding_list = audio_embedding
248
  try :
249
  audio_file = io.BytesIO(audio_data)
 
274
  try:
275
  pdf_url = request.json.get("pdfUrl")
276
  print(1)
277
+ pages_info = "Error"
278
  try :
279
  pages_info = seperate_image_text_from_pdf(pdf_url)
280
  except Exception as e:
 
356
 
357
  except Exception as e:
358
  return jsonify({"error": str(e)}), 500
359
+