Skip to content

Commit c055994

Browse files
docs: update README
1 parent 1bd8463 commit c055994

File tree

5 files changed

+38
-24
lines changed

5 files changed

+38
-24
lines changed

.github/sync-config.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
sync:
2-
- source: graphgen
3-
dest: graphgen
4-
- source: resources/nltk_data
5-
dest: resources/nltk_data
6-
- source: resources/examples
7-
dest: resources/examples
8-
- source: webui
9-
dest: webui
2+
- source: graphgen/
3+
dest: graphgen/
4+
- source: resources/nltk_data/
5+
dest: resources/nltk_data/
6+
- source: resources/examples/
7+
dest: resources/examples/
8+
- source: webui/
9+
dest: webui/
1010
- source: webui/app.py
1111
dest: app.py
1212
- source: requirements.txt

.github/workflows/sync-demo.yml

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,28 @@ jobs:
4242
4343
- name: Copy files using config
4444
run: |
45-
while IFS= read -r line; do
46-
source=$(echo $line | cut -d: -f1 | xargs)
47-
dest=$(echo $line | cut -d: -f2 | xargs)
48-
49-
if [ -e "$source" ]; then
50-
mkdir -p "demo/$(dirname $dest)"
51-
cp -r "$source" "demo/$dest"
52-
echo "Copied $source to $dest"
45+
yq eval '.sync[] | .source + ":" + .dest' .github/sync-config.yml | while IFS=: read -r src dst; do
46+
src=$(echo "$src" | xargs)
47+
dst=$(echo "$dst" | xargs)
48+
49+
[ -z "$src" ] && continue
50+
51+
if [ -e "$src" ]; then
52+
target_path="demo/$dst"
53+
54+
if [[ "$dst" == */ ]] || [ -d "$src" ]; then
55+
mkdir -p "$target_path"
56+
cp -r "$src" "$target_path"
57+
echo "Copied $src → $target_path"
58+
else
59+
mkdir -p "$(dirname "$target_path")"
60+
cp "$src" "$target_path"
61+
echo "Copied $src → $target_path"
62+
fi
63+
else
64+
echo "Source not found: $src"
5365
fi
54-
done < <(grep -E '^\s*-\s+source:' .github/sync-config.yml | sed 's/.*source: //' | paste -d: - <(grep -E '^\s*-\s+dest:' .github/sync-config.yml | sed 's/.*dest: //'))
66+
done
5567
5668
- name: Commit and push changes
5769
run: |

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ For any questions, please check [FAQ](https://github.com/open-sciencelab/GraphGe
100100
### Run Gradio Demo
101101

102102
```bash
103-
uv run webui/app.py
103+
python -m webui.app.py
104104
```
105105

106106
![ui](https://github.com/user-attachments/assets/3024e9bc-5d45-45f8-a4e6-b57bd2350d84)

README_ZH.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,9 @@ GraphGen 首先根据源文本构建细粒度的知识图谱,然后利用期
9898

9999
### 运行 Gradio 演示
100100

101-
```bash
102-
uv run webui/app.py
101+
```bash
102+
python -m webui.app.py
103+
```
103104

104105
![ui](https://github.com/user-attachments/assets/3024e9bc-5d45-45f8-a4e6-b57bd2350d84)
105106

webui/app.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@
55

66
import gradio as gr
77
import pandas as pd
8-
from base import GraphGenParams
9-
from cache_utils import cleanup_workspace, setup_workspace
10-
from count_tokens import count_tokens
118
from gradio_i18n import Translate
129
from gradio_i18n import gettext as _
13-
from test_api import test_api_connection
10+
11+
from webui.base import GraphGenParams
12+
from webui.cache_utils import cleanup_workspace, setup_workspace
13+
from webui.count_tokens import count_tokens
14+
from webui.test_api import test_api_connection
1415

1516
# pylint: disable=wrong-import-position
1617
root_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

0 commit comments

Comments
 (0)