returnToInnocence commented on code in PR #75:
URL:
https://github.com/apache/incubator-hugegraph-ai/pull/75#discussion_r1749423944
##########
hugegraph-llm/src/hugegraph_llm/demo/css.py:
##########
Review Comment:
> shall we move it to `resource/demo`?
At present, for rag_web_demo, it seems that the relevant code scale is
further increasing, such as the existing front-end ui related code part, and
the current `css` style introduction
Is it possible to consider encapsulating a module for `rag_web_demo` and
placing `css` and subsequent split UI-related code in similar
`/rag_web_demo/resource` for rag_web_demo to use?
##########
hugegraph-llm/src/hugegraph_llm/demo/rag_web_demo.py:
##########
@@ -517,27 +524,56 @@ def reranker_settings(reranker_type):
}"""
with gr.Row():
- input_file = gr.File(
- value=[os.path.join(resource_path, "demo", "test.txt")],
- label="Docs (multi-files can be selected together)",
- file_count="multiple",
- )
- input_schema = gr.Textbox(value=schema, label="Schema")
- info_extract_template = gr.Textbox(value=SCHEMA_EXAMPLE_PROMPT,
label="Info extract head")
with gr.Column():
- mode = gr.Radio(
- choices=["Test Mode", "Import Mode", "Clear and Import",
"Rebuild Vector"],
- value="Test Mode",
- label="Build mode",
- )
- btn = gr.Button("Build Vector/Graph RAG")
+ with gr.Tab("file") as tab_upload_file:
Review Comment:
When I tried to switch between different tabs, I found that the files I
uploaded to file would disappear after switching to text and then going back to
file

##########
hugegraph-llm/src/hugegraph_llm/demo/rag_web_demo.py:
##########
@@ -517,27 +524,56 @@ def reranker_settings(reranker_type):
}"""
with gr.Row():
- input_file = gr.File(
- value=[os.path.join(resource_path, "demo", "test.txt")],
- label="Docs (multi-files can be selected together)",
- file_count="multiple",
- )
- input_schema = gr.Textbox(value=schema, label="Schema")
- info_extract_template = gr.Textbox(value=SCHEMA_EXAMPLE_PROMPT,
label="Info extract head")
with gr.Column():
- mode = gr.Radio(
- choices=["Test Mode", "Import Mode", "Clear and Import",
"Rebuild Vector"],
- value="Test Mode",
- label="Build mode",
- )
- btn = gr.Button("Build Vector/Graph RAG")
+ with gr.Tab("file") as tab_upload_file:
+ input_file = gr.File(
+ value=[os.path.join(resource_path, "demo",
"test.txt")],
+ label="Docs (multi-files can be selected together)",
+ file_count="multiple",
+ )
+ with gr.Tab("text") as tab_upload_text:
+ input_text = gr.Textbox(value="", label="Doc(s)",
lines=20, show_copy_button=True)
+ input_schema = gr.Textbox(value=schema, label="Schema", lines=15,
show_copy_button=True)
+ info_extract_template = gr.Textbox(value=SCHEMA_EXAMPLE_PROMPT,
label="Info extract head", lines=15,
+ show_copy_button=True)
+ out = gr.Textbox(label="Output", lines=15, show_copy_button=True)
+
with gr.Row():
- out = gr.Textbox(label="Output", show_copy_button=True)
- btn.click( # pylint: disable=no-member
- fn=build_kg,
- inputs=[input_file, input_schema, info_extract_template, mode],
- outputs=out,
+ vector_index_btn0 = gr.Button("Get Vector Index Info")
Review Comment:
As the function button changes, maybe we should consider the corresponding
function description should also be updated?

--
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]