From 754b12f6293db188b93bfa689ecd7a0e40644d99 Mon Sep 17 00:00:00 2001 From: jinye_huang Date: Sat, 26 Apr 2025 11:40:21 +0800 Subject: [PATCH] =?UTF-8?q?qq=E4=BF=AE=E6=94=B9=E4=BA=86=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SelectPrompt/2025各月节日宣传节点时间表.md | 4 ++-- poster_config.json | 10 ++++------ poster_gen_config.json | 10 ++++++---- test_poster.py | 17 ++++++++++++----- 4 files changed, 24 insertions(+), 17 deletions(-) diff --git a/SelectPrompt/2025各月节日宣传节点时间表.md b/SelectPrompt/2025各月节日宣传节点时间表.md index 1bbe3e4..63dc4fa 100644 --- a/SelectPrompt/2025各月节日宣传节点时间表.md +++ b/SelectPrompt/2025各月节日宣传节点时间表.md @@ -47,7 +47,7 @@ | **春节** | 1月5日-1月27日 | 1月28日-2月4日 | | **情人节** | 2月1日-2月13日 | 2月14日 | | **清明节** | 3月25日-4月3日 | 4月4日-4月6日 | -| **劳动节** | 4月20日-4月30日 | 5月1日-5月5日 | +| **五一** | 4月20日-4月30日 | 5月1日-5月5日 | | **端午节** | 5月21日-5月30日 | 5月31日-6月2日 | | **中秋节** | 9月1日-9月5日 | 9月6日 | | **国庆节** | 9月1日-9月30日 | 10月1日-10月8日 | @@ -76,4 +76,4 @@ | **12月** | 6-7日、13-14日、20-21日、27-28日 | **说明**: -- 调休影响:春节(1月26日周日、2月8日周六上班)、劳动节(4月27日周日上班)、国庆节(9月28日周日、10月11日周六上班),表中已排除调休日。 +- 调休影响:春节(1月26日周日、2月8日周六上班)、五一(4月27日周日上班)、国庆节(9月28日周日、10月11日周六上班),表中已排除调休日。 diff --git a/poster_config.json b/poster_config.json index 06c3282..bcd80dc 100644 --- a/poster_config.json +++ b/poster_config.json @@ -8,17 +8,15 @@ { "type": "Object", "file_path": [ - "./resource/Object/中山温泉宾馆.txt", - "./resource/Object/乌镇民宿.txt", - "./resource/Object/从化客天下·禧悦庄.txt" + "./resource/Object/笔架山居森林度假酒店.txt", + "./resource/Object/乌镇民宿.txt" ] }, { "type": "Description", "file_path": [ - "./resource/Object/中山温泉宾馆.txt", - "./resource/Object/乌镇民宿.txt", - "./resource/Object/从化客天下·禧悦庄.txt" + "./resource/Object/笔架山居森林度假酒店.txt", + "./resource/Object/乌镇民宿.txt" ] }, { diff --git a/poster_gen_config.json b/poster_gen_config.json index 777a595..42f8762 100644 --- a/poster_gen_config.json +++ b/poster_gen_config.json @@ -1,7 +1,7 @@ { "date": "4月30日, 4月28日, 5月1日", - "num": 8, - "variants": 5, + "num": 6, + "variants": 3, "topic_temperature": 0.2, "topic_top_p": 0.3, "topic_presence_penalty": 1.5, @@ -42,13 +42,15 @@ { "type": "Object", "file_path": [ - "./resource/Object/中山温泉宾馆.txt" + "./resource/Object/笔架山居森林度假酒店.txt", + "./resource/Object/乌镇民宿.txt" ] }, { "type": "Description", "file_path": [ - "./resource/Object/中山温泉宾馆.txt" + "./resource/Object/笔架山居森林度假酒店.txt", + "./resource/Object/乌镇民宿.txt" ] }, { diff --git a/test_poster.py b/test_poster.py index 0316bd3..5a9816f 100644 --- a/test_poster.py +++ b/test_poster.py @@ -58,19 +58,20 @@ def main(): parser.add_argument( "--config", type=str, - default="poster_config.json", + default="/root/autodl-tmp/TravelContentCreator/poster_gen_config.json", help="配置文件路径(例如,poster_config.json)" ) parser.add_argument( "--topics_file", type=str, required=True, + default="/root/autodl-tmp/TravelContentCreator/result/2025-04-25_17-27-03/tweet_topic_2025-04-25_17-27-03.json", help="必需的选题JSON文件路径,用于获取海报生成的主题数据。" ) parser.add_argument( "--topic_index", type=int, - default=None, + default=1, help="要生成海报的特定选题索引。如果未提供,将为所有选题生成海报。" ) parser.add_argument( @@ -85,7 +86,7 @@ def main(): help="启用调试级别日志记录。" ) args = parser.parse_args() - + # 调整日志级别(如果启用了调试) if args.debug: logging.getLogger().setLevel(logging.DEBUG) @@ -155,6 +156,9 @@ def main(): collage_subdir = config.get("output_collage_subdir", "collage_img") poster_subdir = config.get("output_poster_subdir", "poster") poster_filename = config.get("output_poster_filename", "poster.jpg") + title_possibility = config.get("title_possibility", 0.3) + collage_style = config.get("collage_style", None) + timeout = config.get("request_timeout", 180) # 检查关键路径 if not poster_assets_dir or not img_base_dir: @@ -203,7 +207,10 @@ def main(): output_collage_subdir=collage_subdir, output_poster_subdir=poster_subdir, output_poster_filename=poster_filename, - system_prompt=poster_content_system_prompt + system_prompt=poster_content_system_prompt, + collage_style=collage_style, + title_possibility=title_possibility, + timeout=timeout ) if posters_attempted: @@ -213,7 +220,7 @@ def main(): logging.warning(f"选题{topic_index}的海报生成被跳过或在早期失败。") except Exception as e: logging.exception(f"处理选题{topic_index}的海报生成时出错:") - + logging.error(f"错误信息: {e}") logging.info(f"--- 完成选题 {topic_index} ---") # 最终化输出