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