Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit d5fdba8

Browse files
Update the README file, modify the knowledge base initialization command and dependency installation, adjust the database path Settings, correct the knowledge file path in the configuration file, and remove unnecessary type declarations.
1 parent a01a648 commit d5fdba8

File tree

6 files changed

+19
-21
lines changed

6 files changed

+19
-21
lines changed

‎README.md‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ flask db upgrade # Synchronize to database
270270
# Initialize knowledge base (Optional, can be done manually in the frontend after starting the frontend project)
271271
# 1. First rename config/init_config.yaml.copy to config/init_config.yaml
272272
# 2. Modify the relevant information in config/init_config.yaml. If you want to initialize the knowledge base, Embedding Model is required
273-
python3 init_knowledge_base.py --init_all
273+
python init_knowledge_base.py --config_file xxxxxxxxx
274274

275275
# Start backend service (The backend service port can also be modified in app.py, currently 30006)
276276
python app.py
@@ -279,11 +279,10 @@ python app.py
279279
cd CrackSQL/webui
280280

281281
# Install dependencies
282-
yarn cache clean
283-
yarn install
282+
pnpm install
284283

285284
# Start development server
286-
yarn dev
285+
pnpm run dev
287286

288287
# Visit http://localhost:50212 to use the Web interface
289288

‎README_ZH.md‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ flask db upgrade # 同步到数据库
171171
# 初始化知识库(可选,也可以在启动前端项目后在前端手动完成)
172172
# 1. 首先将config/init_config.yaml.copy重命名为config/init_config.yaml
173173
# 2. 修改config/init_config.yaml中的相关信息。如果要初始化知识库,需要Embedding Model
174-
python3 init_knowledge_base.py --init_all
174+
python init_knowledge_base.py --config_file xxxxxxxxx
175175

176176
# 启动后端服务(后端服务端口也可以在app.py中修改,目前为30006)
177177
python app.py
@@ -180,11 +180,10 @@ python app.py
180180
cd CrackSQL/webui
181181

182182
# 安装依赖
183-
yarn cache clean
184-
yarn install
183+
pnpm install
185184

186185
# 启动开发服务器
187-
yarn dev
186+
pnpm run dev
188187

189188
# 访问http://localhost:50212使用Web界面
190189

‎backend/app_factory.py‎

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -130,19 +130,20 @@ def create_app(config_name='PRODUCTION', config_path=None):
130130

131131
# Dynamically set database path
132132
# Use user execution directory
133-
current_dir = os.getcwd()
134-
instance_dir = os.path.join(current_dir, 'instance')
135-
logs_dir = os.path.join(current_dir, 'logs')
133+
current_dir = Path.cwd()
134+
instance_dir = current_dir/'instance'
135+
logs_dir = current_dir/'logs'
136136
# Ensure directory exists
137-
os.makedirs(instance_dir, exist_ok=True)
138-
os.makedirs(logs_dir, exist_ok=True)
137+
instance_dir.mkdir(exist_ok=True)
138+
logs_dir.mkdir(exist_ok=True)
139139

140140
# Set database file path
141-
db_path = os.path.join(instance_dir, 'info.db')
141+
db_path = instance_dir/'info.db'
142142
print(f"Using database: {db_path}")
143143

144-
# Update database URI
145-
app.config['SQLALCHEMY_DATABASE_URI'] = f'sqlite:////{db_path}'
144+
# Update database URI - using as_uri() to get the correct format for SQLAlchemy
145+
db_uri = db_path.as_uri().replace('file:', '')
146+
app.config['SQLALCHEMY_DATABASE_URI'] = f'sqlite://{db_uri}'
146147

147148
# Load logging configuration
148149
logging_config_path = app.config.get('LOGGING_CONFIG_PATH')

‎backend/config/init_config.yaml.copy‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,20 +34,20 @@ KNOWLEDGE_BASES:
3434
kb_info: "MySQL数据库知识库,包含MySQL的关键字、函数、操作符等信息" # Knowledge base description
3535
embedding_model: "text-embedding-ada-002" # Embedding model to use
3636
knowledge_files: # Knowledge files to import
37-
- "./data/processed_document/mysql_8_kb.json" # Knowledge file path
37+
- "../data/processed_document/mysql_8_kb.json" # Knowledge file path
3838

3939
# PostgreSQL knowledge base
4040
- kb_name: "postgresql_knowledge" # Knowledge base name
4141
db_type: "postgresql" # Database type
4242
kb_info: "PostgreSQL数据库知识库,包含PostgreSQL的关键字、函数、操作符等信息" # Knowledge base description
4343
embedding_model: "text-embedding-ada-002" # Embedding model to use
4444
knowledge_files: # Knowledge files to import
45-
- "./data/processed_document/pg_14_kb.json"
45+
- "../data/processed_document/pg_14_kb.json"
4646

4747
# Oracle knowledge base
4848
- kb_name: "oracle_knowledge" # Knowledge base name
4949
db_type: "oracle" # Database type
5050
kb_info: "Oracle 数据库知识库,包含Oracle的关键字、函数、操作符等信息" # Knowledge base description
5151
embedding_model: "text-embedding-ada-002" # Embedding model to use
5252
knowledge_files: # Knowledge files to import
53-
- "./data/processed_document/oracle_11_kb.json"
53+
- "../data/processed_document/oracle_11_kb.json"

‎backend/requirements.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ openai>=1.3.0
2626
aiohttp>=3.8.0 # For asynchronous HTTP requests
2727
tenacity>=8.2.0 # For retry mechanism
2828
sentence-transformers>=2.2.0 # For text vectorization
29-
numpy>=1.24.0 # Scientific computing
29+
numpy==1.24.0 # Scientific computing
3030
scikit-learn>=1.0.0 # For vector calculation
3131
chromadb>=0.4.15 # Chroma vector database
3232

‎webui/typings/components.d.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ declare module '@vue/runtime-core' {
1313
CreateKnowledgeBase: typeof import('./../src/components/CreateKnowledgeBase.vue')['default']
1414
DatabaseConfigForm: typeof import('./../src/components/DatabaseConfigForm.vue')['default']
1515
ElSvgIcon: typeof import('./../src/components/ElSvgIcon.vue')['default']
16-
ProcessItem: typeof import('./../src/components/ProcessItem.vue')['default']
1716
RouterLink: typeof import('vue-router')['RouterLink']
1817
RouterView: typeof import('vue-router')['RouterView']
1918
SqlInput: typeof import('./../src/components/SqlInput.vue')['default']

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /