📌 📄 内容摘要:
@bonabarenfei 在 别再吹Gemini pro2.5了,写代码就是一坨XX 中发帖
写了一个最简单的Flask api 服务,给我正确的时候返回一个文本字符串,失败的时候返回一个json??? 🙃连返回的格式统一都做不到,更别说debug一些难搞的bug了
@app.route(‘/ocr’, methods=[‘POST’])
def ocr_service():
data = request.get_json()
if not data or ‘image_path’ not in data:
return jsonify({‘error’: ‘Missing image_path in request body’}), 400
image_path = data['image_path']
if not os.path.exists(image_path):
return jsonify({'error': f'Image not found ...
────────── 链接信息 ────────── 🔗 论坛链接: linux.do 📎 访问地址: https://linux.do/t/topic/822756/1 ─────────────────────────────
📢 来源:LINUX DO