Skip to content

Commit acd4451

Browse files
committed
fix: config
1 parent b301cf0 commit acd4451

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

app/evaluation.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def __init__(self, mode='gpt', llama_version='3_1_8B', temperature=0.01, max_new
2121

2222
self.response_num_required = 0 #initialise it with 0
2323

24-
def setup_llm(config):
24+
def setup_llm(config: Config):
2525
"""Initialize the LLM model (GPT-4o or LLaMA 3) based on the given configuration."""
2626
if config.mode == 'gpt':
2727
return ChatOpenAI(
@@ -79,8 +79,7 @@ def evaluation_function(response, answer, config=None):
7979
start_time = time.process_time()
8080

8181
# Ensure config is provided
82-
if config is None:
83-
config = Config()
82+
config = Config() if len(config) == 0 else config
8483

8584
# Initialize LLM
8685
llm = setup_llm(config)

0 commit comments

Comments
 (0)