Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,8 @@ Furthermore, GraphGen incorporates multi-hop neighborhood sampling to capture co

### Gradio Demo

1. Enter `webui` directory
```bash
cd webui
```
2. Run the Gradio demo
```bash
gradio app.py
gradio webui/app.py
```

![ui](resources/images/interface.jpg)
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ nltk
jieba
plotly
pandas
gradio
gradio>=5.25.0
gradio-i18n==0.3.0
kaleido
pyyaml
Expand Down
12 changes: 6 additions & 6 deletions webui/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,10 @@ def run_graphgen(*arguments: list, progress=gr.Progress()):
except Exception as e: # pylint: disable=broad-except
raise gr.Error(f"Error occurred: {str(e)}")


with gr.Blocks(title="GraphGen Demo", theme=gr.themes.Glass(),
css=css) as demo:
# Header
gr.Image(value=f"{root_dir}/resources/images/logo.png",
gr.Image(value=os.path.join(root_dir, 'resources', 'images', 'logo.png'),
label="GraphGen Banner",
elem_id="banner",
interactive=False,
Expand Down Expand Up @@ -210,7 +209,7 @@ def run_graphgen(*arguments: list, progress=gr.Progress()):
</div>
""")
with Translate(
"translation.json",
os.path.join(root_dir, 'webui', 'translation.json'),
lang_btn,
placeholder_langs=["en", "zh"],
persistant=
Expand Down Expand Up @@ -328,10 +327,11 @@ def run_graphgen(*arguments: list, progress=gr.Progress()):
file_types=[".txt", ".json", ".jsonl"],
interactive=True,
)
examples_dir = os.path.join(root_dir, 'webui', 'examples')
gr.Examples(examples=[
[f"{root_dir}/webui/examples/txt_demo.txt"],
[f"{root_dir}/webui/examples/raw_demo.jsonl"],
[f"{root_dir}/webui/examples/chunked_demo.json"],
[os.path.join(examples_dir, "txt_demo.txt")],
[os.path.join(examples_dir, "raw_demo.jsonl")],
[os.path.join(examples_dir, "chunked_demo.json")],
],
inputs=upload_file,
label="Example Files",
Expand Down
4 changes: 2 additions & 2 deletions webui/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"en": {
"Title": "✨Easy-to-use LLM Training Data Generation Framework✨",
"Intro": "is a framework for synthetic data generation guided by knowledge graphs, designed to tackle challenges for knowledge-intensive QA generation. \n\nBy uploading your text chunks (such as knowledge in agriculture, healthcare, or marine science) and filling in the LLM API key, you can generate the training data required by **LLaMA-Factory** and **xtuner** online. We will automatically delete user information after completion.",
"Use Trainee Model": "Use Trainee Model to identify knowledge blind spots, disable by default",
"Use Trainee Model": "Use Trainee Model to identify knowledge blind spots, please keep disable for SiliconCloud",
"Base URL Info": "Base URL for the API, use SiliconFlow as default",
"Synthesizer Model Info": "Model for constructing KGs and generating QAs",
"Trainee Model Info": "Model for training",
Expand All @@ -12,7 +12,7 @@
"zh": {
"Title": "✨开箱即用的LLM训练数据生成框架✨",
"Intro": "是一个基于知识图谱的合成数据生成框架,旨在解决知识密集型问答生成的挑战。\n\n 上传你的文本块(如农业、医疗、海洋知识),填写 LLM api key,即可在线生成 **LLaMA-Factory**、**xtuner** 所需训练数据。结束后我们将自动删除用户信息。",
"Use Trainee Model": "使用Trainee Model来识别知识盲区,默认禁用",
"Use Trainee Model": "使用Trainee Model来识别知识盲区,使用硅基流动时请保持禁用",
"Base URL Info": "调用模型API的URL,默认使用硅基流动",
"Synthesizer Model Info": "用于构建知识图谱和生成问答的模型",
"Trainee Model Info": "用于训练的模型",
Expand Down