欠费处理
This commit is contained in:
6
main.py
6
main.py
@@ -29,7 +29,11 @@ def main():
|
||||
image_path = Path(root_folder) / image
|
||||
|
||||
if check_emoji(emoji_uuid):
|
||||
description = gen.process_single_image(str(image_path))
|
||||
try:
|
||||
description = gen.process_single_image(str(image_path))
|
||||
except AttributeError:
|
||||
logger.warning("AI模型未响应,请检查是否欠费!")
|
||||
break
|
||||
update_description(emoji_uuid, description)
|
||||
if description:
|
||||
logger.info(f"图片 {emoji_file} 的描述词生成完毕,序号:{i + 1}, 其 description 为: {description}")
|
||||
|
||||
@@ -37,6 +37,8 @@ class Generator:
|
||||
|
||||
return None
|
||||
|
||||
except AttributeError as e:
|
||||
raise AttributeError(e)
|
||||
except Exception as e:
|
||||
logger.error(f"API调用失败: {e}")
|
||||
return None
|
||||
|
||||
Reference in New Issue
Block a user