Add Mistral, Qwen, Gemini support; Fix minor bugs

This commit is contained in:
Timothyxxx
2024-02-01 16:55:38 +08:00
parent 4ef0dd59af
commit 59e2417a08
7 changed files with 156 additions and 287 deletions

View File

@@ -30,7 +30,7 @@ def _execute_command(command: List[str]) -> None:
p = subprocess.Popen(command)
p.wait()
else:
result = subprocess.run(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, timeout=60, text=True)
result = subprocess.run(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, timeout=60, text=True, encoding="utf-8")
if result.returncode != 0:
raise Exception("\033[91m" + result.stdout + result.stderr + "\033[0m")
return result.stdout

View File

@@ -328,6 +328,9 @@ def check_structure_sim(src_path, tgt_path):
Check if the structure of the two images are similar
gimp:2a729ded-3296-423d-aec4-7dd55ed5fbb3
"""
if src_path is None or tgt_path is None:
return 0.
img_src = Image.open(src_path)
img_tgt = Image.open(tgt_path)
structure_same = structure_check_by_ssim(img_src, img_tgt)