Spaces:
Running
Running
Update src/refinement/refinement.py
Browse files
src/refinement/refinement.py
CHANGED
|
@@ -15,7 +15,7 @@ from playwright.sync_api import sync_playwright
|
|
| 15 |
|
| 16 |
|
| 17 |
class VLMCommenter:
|
| 18 |
-
def __init__(self, api_key, prompt, provider="openai", model_name=None):
|
| 19 |
"""
|
| 20 |
:param api_key: API Key
|
| 21 |
:param prompt: 提示词文本
|
|
@@ -94,7 +94,7 @@ class VLMCommenter:
|
|
| 94 |
|
| 95 |
|
| 96 |
class LLMReviser:
|
| 97 |
-
def __init__(self, api_key, prompt, provider="openai", model_name=None):
|
| 98 |
"""
|
| 99 |
:param api_key: API Key
|
| 100 |
:param prompt: 提示词文本
|
|
@@ -317,8 +317,8 @@ def refine_one_slide(input_path, output_path, prompts, outline, max_iterations,
|
|
| 317 |
|
| 318 |
platform = "gemini" if "gemini" in model.lower() else "openai"
|
| 319 |
|
| 320 |
-
vlm = VLMCommenter(api_key, commenter_prompt, provider=platform, model_name=model)
|
| 321 |
-
reviser = LLMReviser(api_key, reviser_prompt, provider=platform, model_name=model)
|
| 322 |
|
| 323 |
current_input = input_path
|
| 324 |
critic_his = ""
|
|
|
|
| 15 |
|
| 16 |
|
| 17 |
class VLMCommenter:
|
| 18 |
+
def __init__(self, api_key, prompt, provider="openai", model_name=None, config=None):
|
| 19 |
"""
|
| 20 |
:param api_key: API Key
|
| 21 |
:param prompt: 提示词文本
|
|
|
|
| 94 |
|
| 95 |
|
| 96 |
class LLMReviser:
|
| 97 |
+
def __init__(self, api_key, prompt, provider="openai", model_name=None, config=None):
|
| 98 |
"""
|
| 99 |
:param api_key: API Key
|
| 100 |
:param prompt: 提示词文本
|
|
|
|
| 317 |
|
| 318 |
platform = "gemini" if "gemini" in model.lower() else "openai"
|
| 319 |
|
| 320 |
+
vlm = VLMCommenter(api_key, commenter_prompt, provider=platform, model_name=model, config=config)
|
| 321 |
+
reviser = LLMReviser(api_key, reviser_prompt, provider=platform, model_name=model, config=config)
|
| 322 |
|
| 323 |
current_input = input_path
|
| 324 |
critic_his = ""
|