Spaces:
Sleeping
Sleeping
Update app.py
Browse files270 unmodified lines2712722732742752762772782792802811 unmodified line283284285286287288289290291292293294295296297298293299300301302270 unmodified lines@cache.cached(timeout=300)@app.route('/extract_pdf_text_and_embedding', methods=['POST'])def extract_pdf_text_and_embedding(): list = [] try: list.append(1) pdf_url = request.json.get("pdfUrl") list.append(2) print(1) pages_info = "Error" try :1 unmodified line except Exception as e: print(e) return jsonify({"error": "Failed to fetch the PDF from the URL"}), 500 list.append(3) if(pages_info == "Error"): return jsonify({"error": "Failed to fetch the PDF from the URL seperate_image_text_from_pdf "}), 500 list.append(4) content = pdf_image_text_embedding_and_text_embedding(pages_info) if content == "Error": return jsonify({"error": "An error occurred while processing the PDF"}), 500 list.append(5) print(content) return jsonify({"content": content}), 200
except Exception as e: print(e) return jsonify({"error": str(e)}), 500 return jsonify({"error": str(list)}), 500
# Route to get text description embeddings@cache.cached(timeout=300)app.py+7-1