Skip to content

Commit c15ef5f

Browse files
committed
* fix task parser
1 parent ec45e8c commit c15ef5f

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

tests/data/controllers/task_parser_test.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# -*- coding: utf-8 -*-
22
"""Test cases for data task parser."""
3+
import os
34
import unittest
45

56
import agentscope
@@ -16,7 +17,7 @@ class TestTaskParser(unittest.TestCase):
1617
def setUp(self) -> None:
1718
print("setup", flush=True)
1819

19-
api_key = "your_dashscope_key"
20+
api_key = os.environ.get("OPENAI_API_KEY", None)
2021

2122
agentscope.init(
2223
model_configs=[

trinity/data/controllers/task_parser.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,11 @@ def parse_to_dj_config(self, extra_op_args=None):
164164
return dj_config, hit_cleaner, hit_synthesizer, hit_human_annotator
165165

166166
def _check_types_of_processors(self, dj_config):
167+
if dj_config is None:
168+
return False, False, False
167169
hit_cleaner, hit_synthesizer, hit_human_annotator = False, False, False
168-
for op in dj_config.process:
170+
process_list = dj_config.get('process', [])
171+
for op in process_list:
169172
op_name = list(op.keys())[0]
170173
if op_name in DEFAULT_CLEANER:
171174
hit_cleaner = True

0 commit comments

Comments
 (0)