Skip to content

Commit be9579d

Browse files
fix: change variable name
1 parent 6150276 commit be9579d

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

generate.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def save_config(global_config):
4848
api_key=os.getenv("SYNTHESIZER_API_KEY"),
4949
base_url=os.getenv("SYNTHESIZER_BASE_URL")
5050
)
51-
training_llm_client = OpenAIModel(
51+
trainee_llm_client = OpenAIModel(
5252
model_name=os.getenv("TRAINEE_MODEL"),
5353
api_key=os.getenv("TRAINEE_API_KEY"),
5454
base_url=os.getenv("TRAINEE_BASE_URL")
@@ -61,7 +61,7 @@ def save_config(global_config):
6161
graph_gen = GraphGen(
6262
unique_id=unique_id,
6363
synthesizer_llm_client=synthesizer_llm_client,
64-
training_llm_client=training_llm_client,
64+
trainee_llm_client=trainee_llm_client,
6565
if_web_search=config['web_search'],
6666
tokenizer_instance=Tokenizer(
6767
model_name=config['tokenizer']

graphgen/graphgen.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class GraphGen:
2929

3030
# llm
3131
synthesizer_llm_client: OpenAIModel = None
32-
training_llm_client: OpenAIModel = None
32+
trainee_llm_client: OpenAIModel = None
3333
tokenizer_instance: Tokenizer = None
3434

3535
# web search
@@ -181,7 +181,7 @@ def judge(self, re_judge=False):
181181
loop.run_until_complete(self.async_judge(re_judge))
182182

183183
async def async_judge(self, re_judge=False):
184-
_update_relations = await judge_statement(self.training_llm_client, self.graph_storage,
184+
_update_relations = await judge_statement(self.trainee_llm_client, self.graph_storage,
185185
self.rephrase_storage, re_judge)
186186
await _update_relations.index_done_callback()
187187

graphgen/operators/judge.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77

88

99
async def judge_statement( # pylint: disable=too-many-statements
10-
training_llm_client: OpenAIModel,
10+
trainee_llm_client: OpenAIModel,
1111
graph_storage: NetworkXStorage,
1212
rephrase_storage: JsonKVStorage,
1313
re_judge: bool = False,
1414
max_concurrent: int = 1000) -> NetworkXStorage:
1515
"""
1616
Get all edges and nodes and judge them
1717
18-
:param training_llm_client: judge the statements to get comprehension loss
18+
:param trainee_llm_client: judge the statements to get comprehension loss
1919
:param graph_storage: graph storage instance
2020
:param rephrase_storage: rephrase storage instance
2121
:param re_judge: re-judge the relations
@@ -46,7 +46,7 @@ async def _judge_single_relation(
4646
judgements = []
4747
gts = [gt for _, gt in descriptions]
4848
for description, gt in descriptions:
49-
judgement = await training_llm_client.generate_topk_per_token(
49+
judgement = await trainee_llm_client.generate_topk_per_token(
5050
STATEMENT_JUDGEMENT_PROMPT['TEMPLATE'].format(statement=description)
5151
)
5252
judgements.append(judgement[0].top_candidates)
@@ -94,7 +94,7 @@ async def _judge_single_entity(
9494
judgements = []
9595
gts = [gt for _, gt in descriptions]
9696
for description, gt in descriptions:
97-
judgement = await training_llm_client.generate_topk_per_token(
97+
judgement = await trainee_llm_client.generate_topk_per_token(
9898
STATEMENT_JUDGEMENT_PROMPT['TEMPLATE'].format(statement=description)
9999
)
100100
judgements.append(judgement[0].top_candidates)

webui/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def init_graph_gen(config: dict, env: dict) -> GraphGen:
4343
api_key=env.get("SYNTHESIZER_API_KEY", "")
4444
)
4545

46-
graph_gen.training_llm_client = OpenAIModel(
46+
graph_gen.trainee_llm_client = OpenAIModel(
4747
model_name=env.get("TRAINEE_MODEL", ""),
4848
base_url=env.get("TRAINEE_BASE_URL", ""),
4949
api_key=env.get("TRAINEE_API_KEY", "")

0 commit comments

Comments
 (0)