Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def llm():
api_url='',
# model='',
)
res = DetectTextQualityDetail.call_api(MetaData(
res = DetectTextQualityDetail.eval(MetaData(
data_id='123',
prompt="hello, introduce the world",
content="Hello! The world is a vast and diverse place, full of wonders, cultures, and incredible natural beauty."
Expand Down
2 changes: 1 addition & 1 deletion README_zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def llm():
api_url='',
# model='',
)
res = DetectTextQualityDetail.call_api(MetaData(
res = DetectTextQualityDetail.eval(MetaData(
data_id='123',
prompt="hello, introduce the world",
content="Hello! The world is a vast and diverse place, full of wonders, cultures, and incredible natural beauty."
Expand Down
2 changes: 1 addition & 1 deletion dingo/exec/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ def evaluate_prompt(self, group: List[BasePrompt], d: MetaData) -> ResultInfo:
for p in group:
self.llm.set_prompt(p)
# execute prompt
tmp: ModelRes = self.llm.call_api(d)
tmp: ModelRes = self.llm.eval(d)
# analyze result
if tmp.error_status:
result_info.error_status = True
Expand Down
2 changes: 1 addition & 1 deletion dingo/exec/spark.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ def _evaluate_prompt(self, group: List[BasePrompt], data: MetaData, llm: BaseLLM

for prompt in group:
llm.set_prompt(prompt)
res: ModelRes = llm.call_api(data)
res: ModelRes = llm.eval(data)

if res.error_status:
result_info.error_status = True
Expand Down
2 changes: 1 addition & 1 deletion dingo/model/llm/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ def set_prompt(cls, prompt: BasePrompt):
...

@classmethod
def call_api(cls, input_data: MetaData) -> ModelRes:
def eval(cls, input_data: MetaData) -> ModelRes:
...
2 changes: 1 addition & 1 deletion dingo/model/llm/base_lmdeploy_apiclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def process_response(cls, response: str) -> ModelRes:
return result

@classmethod
def call_api(cls, input_data: MetaData) -> ModelRes:
def eval(cls, input_data: MetaData) -> ModelRes:
if cls.client is None:
cls.create_client()

Expand Down
2 changes: 1 addition & 1 deletion dingo/model/llm/base_openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def process_response(cls, response: str) -> ModelRes:
return result

@classmethod
def call_api(cls, input_data: MetaData) -> ModelRes:
def eval(cls, input_data: MetaData) -> ModelRes:
if cls.client is None:
cls.create_client()

Expand Down
2 changes: 1 addition & 1 deletion dingo/model/llm/detect_perspective.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def create_client(cls):
)

@classmethod
def call_api(cls, input_data: MetaData) -> ModelRes:
def eval(cls, input_data: MetaData) -> ModelRes:
cls.create_client()
analyze_request = {
'comment': {'text': input_data.content},
Expand Down
2 changes: 1 addition & 1 deletion dingo/model/llm/detect_text_quality_detail.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,5 @@ def process_response(cls, response: str) -> ModelRes:
api_url='',
# model='',
)
res = DetectTextQualityDetail.call_api(MetaData(data_id='123', content="hello, introduce the world"))
res = DetectTextQualityDetail.eval(MetaData(data_id='123', content="hello, introduce the world"))
print(res)
2 changes: 1 addition & 1 deletion examples/core/score.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def llm():
api_url='',
# model='',
)
res = DetectTextQualityDetail.call_api(MetaData(
res = DetectTextQualityDetail.eval(MetaData(
data_id='123',
prompt="hello, introduce the world",
content="Hello! The world is a vast and diverse place, full of wonders, cultures, and incredible natural beauty."
Expand Down