vichayturen commented on code in PR #75:
URL:
https://github.com/apache/incubator-hugegraph-ai/pull/75#discussion_r1750530527
##########
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:
The modification has been completed
--
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]