-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathenv.example
More file actions
119 lines (91 loc) · 4.32 KB
/
env.example
File metadata and controls
119 lines (91 loc) · 4.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# =============================================================================
# LegalGraphRAG Configuration File Example
# =============================================================================
# Copy this file to .env and modify configuration values according to your needs
# cp env.example .env
# =============================================================================
# Model Configuration (ModelConfig)
# =============================================================================
# Model name, options: qwen3, qwen2_5, gemma3, internlm3, glm4, deepseek_v3, gpt4o_mini
model_name=qwen3
# GPU device, e.g.: cuda:0, cuda:1, cuda:2, cuda:3, cpu
device=cuda:0
# API key (only required for OpenAI-type models: deepseek_v3, gpt4o_mini)
# For deepseek_v3, environment variable should be DEEPSEEK_API_KEY
# For gpt4o_mini, environment variable should be OPENAI_API_KEY
# Can also be set here, but using environment variables is recommended
api_key=
# API base URL (only required for OpenAI-type models)
# deepseek_v3 default: https://api.deepseek.com/v1
# gpt4o_mini default: https://api.openai.com/v1
base_url=http://localhost:8000/v1
# Maximum generation length (number of tokens)
max_length=4096
# Temperature parameter (controls generation randomness, 0.0-1.0)
temperature=0.1
# =============================================================================
# Data Preprocessing LLM Configuration
# =============================================================================
# Used by scripts/prepare_law_judge_dep.py and scripts/prepare_data.py
law_judge_dep_model=deepseek-chat
law_judge_dep_base_url=https://api.deepseek.com/v1
law_judge_dep_min_law_id=102
# Optional. If empty, script falls back to DEEPSEEK_API_KEY / OPENAI_API_KEY / api_key.
law_judge_dep_api_key=
# Used by scripts/prepare_case_features.py and scripts/prepare_data.py
case_features_model=deepseek-chat
case_features_base_url=https://api.deepseek.com/v1
case_features_max_tokens=1024
# Optional. If empty, script falls back to DEEPSEEK_API_KEY / OPENAI_API_KEY / api_key.
case_features_api_key=
# =============================================================================
# Data Configuration (DataConfig)
# =============================================================================
# Case database path
case_db_path=./datas/cases_with_feature.json
# Law to crime mapping file path
law_to_crime_path=./datas/law_to_crime.json
# Dataset root directory path (optional, for loading test datasets)
datasets_path=./datasets
# Output directory
output_dir=./outputs
# =============================================================================
# Retrieval Configuration (RetrieveConfig)
# =============================================================================
# Enable top retrieval
top_retrieve=True
# Enable direct retrieval
direct_retrieve=True
# Enable augment retrieval
augment_retrieve=True
# Top retrieval top_k value
top_retrieve_top_k=3
# Direct retrieval top_k value
direct_retrieve_top_k=3
# =============================================================================
# Graph Database Configuration (GraphConfig)
# =============================================================================
# Graph database save/load path (optional, if set enables auto load/save)
graph_db_path=
# Embedding API URL (for generating text vectors)
embedding_api_url=http://localhost:11434/api/embed
# Embedding model name
embedding_model=bge-m3
# Auto-save graph database (when program exits)
auto_save=True
# Auto-build graph if database doesn't exist (default: True)
# Set to False to disable auto-build, need to manually call build_graph() method
auto_build=True
# =============================================================================
# Usage Instructions
# =============================================================================
# 1. Copy this file: cp env.example .env
# 2. Modify configuration values according to your needs
# 3. For OpenAI-type models (deepseek_v3, gpt4o_mini), need to set:
# - api_key: API key (or set environment variable DEEPSEEK_API_KEY / OPENAI_API_KEY)
# - base_url: API base URL
# 4. Ensure data file paths are correct:
# - case_db_path: Case database file
# - law_to_crime_path: Law to crime mapping file
# 5. If using graph database, set graph_db_path to enable auto load/save
# 6. Boolean values use string "True" or "False" (case sensitive)