Skip to content

Commit ec22729

Browse files
committed
release v0.1.5
1 parent 161ce65 commit ec22729

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

editscore/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@ def evaluate(self, image_prompts, text_prompt):
9999
if result_SC in ["I'm sorry, but I can't assist with that request."] or result_PQ in ["I'm sorry, but I can't assist with that request."]:
100100
guess_if_cannot_parse = True
101101

102-
SC_dict = mllm_output_to_dict(result_SC, give_up_parsing=guess_if_cannot_parse, text_prompt=text_prompt)
103-
PQ_dict = mllm_output_to_dict(result_PQ, give_up_parsing=guess_if_cannot_parse, text_prompt=text_prompt)
102+
SC_dict = mllm_output_to_dict(result_SC, give_up_parsing=guess_if_cannot_parse, text_prompt=text_prompt, score_range=self.score_range)
103+
PQ_dict = mllm_output_to_dict(result_PQ, give_up_parsing=guess_if_cannot_parse, text_prompt=text_prompt, score_range=self.score_range)
104104

105105
if SC_dict == "rate_limit_exceeded" or PQ_dict == "rate_limit_exceeded":
106106
print("rate_limit_exceeded")

editscore/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ def normalize_quotes(s: str) -> str:
201201
return s.replace("“", '"').replace("”", '"').replace("‘", "'").replace("’", "'")
202202

203203
#+=========================================================================================
204-
def mllm_output_to_dict(input_string, give_up_parsing=False, text_prompt=None):
204+
def mllm_output_to_dict(input_string, give_up_parsing=False, text_prompt=None, score_range: int = 10):
205205
"""
206206
Args:
207207
input_string (str): actually the output of the mllm model to be parsed
@@ -212,7 +212,7 @@ def mllm_output_to_dict(input_string, give_up_parsing=False, text_prompt=None):
212212
return "rate_limit_exceeded"
213213

214214
if give_up_parsing:
215-
guessed_value = random.randint(0, 10)
215+
guessed_value = random.randint(0, score_range)
216216
json_content = {'score': [guessed_value], "reasoning": f"guess_if_cannot_parse | {input_string}"}
217217
return json_content
218218

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "editscore"
7-
version = "0.1.4"
7+
version = "0.1.5"
88
authors = [
99
{ name="Xin Luo", email="[email protected]" },
1010
{ name="Jiahao Wang", email="[email protected]" },

0 commit comments

Comments
 (0)