From 8cc9af06b9317b86f715a5bed0b3d7be46142824 Mon Sep 17 00:00:00 2001 From: JimmyZhengyz Date: Wed, 30 Jul 2025 13:08:54 +0800 Subject: [PATCH] Update html_generator.py Add qwen, gpt, gemini functions --- html_generator.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/html_generator.py b/html_generator.py index d94438a..8cd40ea 100644 --- a/html_generator.py +++ b/html_generator.py @@ -1,4 +1,4 @@ -from utils import encode_image, Doubao, Qwen_2_5_VL +from utils import encode_image, Doubao, Qwen, GPT, Gemini from PIL import Image import bs4 from threading import Thread @@ -376,9 +376,12 @@ if __name__ == "__main__": generate_html(root, 'data/tmp/test2_layout.html') # Initialize the bot + # Change your model & API ket path according to your needs bot = Doubao("doubao_api.txt", model = "doubao-1.5-thinking-vision-pro-250428") - # bot = Qwen_2_5_VL("qwen_api.txt", model="qwen2.5-vl-72b-instruct") - + # bot = Qwen("qwen_api.txt", model="qwen2.5-vl-72b-instruct") + # bot = GPT("gpt_api.txt", model="gpt-4o") + # bot = Gemini("gemini_api.txt", model="gemini-1.5-flash-latest") + # Generate code for each component # code_dict = generate_code(root, img_path, bot) @@ -388,4 +391,4 @@ if __name__ == "__main__": code_substitution('data/tmp/test2_layout.html', code_dict) # Refine the html file - # html_refinement('data/tmp/test1_layout.html', 'data/tmp/test1_layout_refined.html', img_path, bot) \ No newline at end of file + # html_refinement('data/tmp/test1_layout.html', 'data/tmp/test1_layout_refined.html', img_path, bot)