Spaces:
Runtime error
Runtime error
Update main.py
Browse files
main.py
CHANGED
|
@@ -137,7 +137,7 @@ def generate_outfit_from_clothes(upper_body_urls: list, lower_body_urls: list) -
|
|
| 137 |
回傳生成圖片的 URL。
|
| 138 |
"""
|
| 139 |
logging.info("Attempting to generate a new outfit image.")
|
| 140 |
-
prompt = "
|
| 141 |
|
| 142 |
all_images_base64 = (
|
| 143 |
[get_base64_from_url(url) for url in upper_body_urls] +
|
|
@@ -224,7 +224,7 @@ tools = [generate_outfit_from_clothes, analyze_image_with_text]
|
|
| 224 |
llm = ChatGoogleGenerativeAI(google_api_key=google_api, model="gemini-2.5-flash", temperature=0.2)
|
| 225 |
# 建立提示模板
|
| 226 |
prompt_template = ChatPromptTemplate([
|
| 227 |
-
("system", "
|
| 228 |
("user", "{input}"),
|
| 229 |
("placeholder", "{agent_scratchpad}"),
|
| 230 |
])
|
|
|
|
| 137 |
回傳生成圖片的 URL。
|
| 138 |
"""
|
| 139 |
logging.info("Attempting to generate a new outfit image.")
|
| 140 |
+
prompt = "使用提供的上衣和褲子/裙子圖片,生成一套完整且時尚的穿搭圖片。請將衣服呈現在一個有模特兒穿著或是在平面上呈現的完整畫面中。風格應與提供的衣物相符。都使用繁體中文回覆。"
|
| 141 |
|
| 142 |
all_images_base64 = (
|
| 143 |
[get_base64_from_url(url) for url in upper_body_urls] +
|
|
|
|
| 224 |
llm = ChatGoogleGenerativeAI(google_api_key=google_api, model="gemini-2.5-flash", temperature=0.2)
|
| 225 |
# 建立提示模板
|
| 226 |
prompt_template = ChatPromptTemplate([
|
| 227 |
+
("system", "你是一個強大的圖像生成與虛擬穿搭問答助理,可以根據用戶的請求使用提供的工具。當你執行 generate_and_upload_image 工具\ 成功後會獲得一個 URL,然後你回答的 output 要包含有這個 URL 的完整資訊。如果工具有產生錯誤訊息請解讀並回應。都使用繁體中文回覆。"),
|
| 228 |
("user", "{input}"),
|
| 229 |
("placeholder", "{agent_scratchpad}"),
|
| 230 |
])
|