Skip to content

Commit 1bad3d3

Browse files
committed
feat(project): update
1 parent 88d8268 commit 1bad3d3

File tree

4 files changed

+9
-10
lines changed

4 files changed

+9
-10
lines changed

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,13 @@ Furthermore, GraphGen incorporates multi-hop neighborhood sampling to capture co
3636

3737
### Gradio Demo
3838

39+
1. Enter `webui` directory
3940
```bash
40-
pip install -r requirements.txt
41-
gradio webui/app.py
41+
cd webui
42+
```
43+
2. Run the Gradio demo
44+
```bash
45+
gradio app.py
4246
```
4347

4448
![ui](resources/images/interface.jpg)

evaluate.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,6 @@
55
import argparse
66
import pandas as pd
77
from dotenv import load_dotenv
8-
try:
9-
import torch
10-
import torch.multiprocessing as mp
11-
except Exception as e:
12-
print(f'Please install torch and torch.multiprocessing to use {__file__}')
138
from models import LengthEvaluator, MTLDEvaluator, RewardEvaluator, TextPair, UniEvaluator
149
from utils import logger, set_logger
1510

@@ -74,11 +69,13 @@ def evaluate_uni(corpus, uni_model_name):
7469

7570

7671
def clean_gpu_cache():
72+
import torch
7773
if torch.cuda.is_available():
7874
torch.cuda.empty_cache()
7975

8076

8177
if __name__ == '__main__':
78+
import torch.multiprocessing as mp
8279
parser = argparse.ArgumentParser()
8380

8481
parser.add_argument('--folder', type=str, default='cache/data', help='folder to load data')

graphgen/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +0,0 @@
1-
from .version import __version__
2-
from .graphgen import GraphGen

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
tqdm
22
openai
3-
python - dotenv
3+
python-dotenv
44
numpy
55
networkx
66
graspologic

0 commit comments

Comments
 (0)