Skip to content

Commit c37a337

Browse files
refactor: use importlib
1 parent 7ac6618 commit c37a337

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

webui/app.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import os
33
import sys
44
import tempfile
5+
from importlib.resources import files
56

67
import gradio as gr
78
import pandas as pd
@@ -15,7 +16,8 @@
1516
from webui.test_api import test_api_connection
1617

1718
# pylint: disable=wrong-import-position
18-
root_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
19+
# root_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
20+
root_dir = files("webui").parent
1921
sys.path.append(root_dir)
2022

2123
from graphgen.graphgen import GraphGen

0 commit comments

Comments
 (0)