diff --git a/app.py b/app.py index bae7a9f..5a9f371 100644 --- a/app.py +++ b/app.py @@ -52,5 +52,6 @@ def create_app() -> Flask: if __name__ == "__main__": port = int(os.environ.get("PORT", "7860")) + debug = os.environ.get("FLASK_DEBUG", "0") == "1" app = create_app() - app.run(host="0.0.0.0", port=port, debug=True) + app.run(host="0.0.0.0", port=port, debug=debug) diff --git a/compiler.py b/compiler.py index b0fcf5d..9ae6e24 100644 --- a/compiler.py +++ b/compiler.py @@ -212,7 +212,12 @@ def to_yaml(nodes: list[NormalizedNode], relations: list[NormalizedRelation]) -> ) doc = {"entities": entities, "relations": rel_items} - return yaml.safe_dump(doc, sort_keys=False) + return yaml.safe_dump( + doc, + sort_keys=False, + default_flow_style=False, + allow_unicode=True, + ) def compile_graph(graph: dict[str, Any]) -> str: