imbajin commented on code in PR #151:
URL:
https://github.com/apache/incubator-hugegraph-ai/pull/151#discussion_r1900765282
##########
hugegraph-llm/src/hugegraph_llm/demo/rag_demo/other_block.py:
##########
@@ -35,3 +54,102 @@ def create_other_block():
out = gr.Textbox(label="Init Graph Demo Result",
show_copy_button=True)
btn = gr.Button("(BETA) Init HugeGraph test data (🚧)")
btn.click(fn=init_hg_test_data, inputs=inp, outputs=out) # pylint:
disable=no-member
+
+
+def create_dir_safely(path):
+ if not os.path.exists(path):
+ os.makedirs(path)
+
+# TODO: move the logic to a separate file
+def backup_data():
+ try:
+ client = PyHugeClient(
+ huge_settings.graph_ip,
+ huge_settings.graph_port,
+ huge_settings.graph_name,
+ huge_settings.graph_user,
+ huge_settings.graph_pwd,
+ huge_settings.graph_space,
+ )
Review Comment:
we could reuse the client object instead of create a new one everywhere..
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]