Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -170,8 +170,8 @@ def generate_amazon_listing(api_key_input, quote, niche, target, keywords):
|
|
| 170 |
# --- ENFORCE CHARACTER LIMITS ---
|
| 171 |
title = result.get("title", "")[:TITLE_MAX_LEN]
|
| 172 |
brand_name = result.get("brand_name", "")[:BRAND_NAME_MAX_LEN]
|
| 173 |
-
|
| 174 |
-
|
| 175 |
suggested_keywords = result.get("suggested_keywords", "Error generating suggested keywords")
|
| 176 |
|
| 177 |
# --- VALIDATION (using potentially truncated values) ---
|
|
@@ -214,9 +214,9 @@ def generate_amazon_listing(api_key_input, quote, niche, target, keywords):
|
|
| 214 |
response_var = model.generate_content(
|
| 215 |
variations_prompt,
|
| 216 |
generation_config={
|
| 217 |
-
"temperature": 0.
|
| 218 |
"top_p": 0.7,
|
| 219 |
-
"max_output_tokens":
|
| 220 |
"response_mime_type": "application/json"
|
| 221 |
}
|
| 222 |
)
|
|
@@ -311,7 +311,7 @@ def create_interface():
|
|
| 311 |
submit_btn = gr.Button("Generate Amazon Listing", variant="primary")
|
| 312 |
|
| 313 |
with gr.Column(scale=2):
|
| 314 |
-
status = gr.Textbox(label="Status", value="Ready", interactive=False, lines=1
|
| 315 |
output = gr.Textbox(label="Generated Amazon Listing", lines=25, interactive=True) # Make output selectable
|
| 316 |
|
| 317 |
# This function is called when the button is clicked
|
|
|
|
| 170 |
# --- ENFORCE CHARACTER LIMITS ---
|
| 171 |
title = result.get("title", "")[:TITLE_MAX_LEN]
|
| 172 |
brand_name = result.get("brand_name", "")[:BRAND_NAME_MAX_LEN]
|
| 173 |
+
bullet1 = result.get("bullet_point_1", "")
|
| 174 |
+
bullet2 = result.get("bullet_point_2", "")
|
| 175 |
suggested_keywords = result.get("suggested_keywords", "Error generating suggested keywords")
|
| 176 |
|
| 177 |
# --- VALIDATION (using potentially truncated values) ---
|
|
|
|
| 214 |
response_var = model.generate_content(
|
| 215 |
variations_prompt,
|
| 216 |
generation_config={
|
| 217 |
+
"temperature": 0.3,
|
| 218 |
"top_p": 0.7,
|
| 219 |
+
"max_output_tokens": 1024,
|
| 220 |
"response_mime_type": "application/json"
|
| 221 |
}
|
| 222 |
)
|
|
|
|
| 311 |
submit_btn = gr.Button("Generate Amazon Listing", variant="primary")
|
| 312 |
|
| 313 |
with gr.Column(scale=2):
|
| 314 |
+
status = gr.Textbox(label="Status", value="Ready", interactive=False, lines=1)
|
| 315 |
output = gr.Textbox(label="Generated Amazon Listing", lines=25, interactive=True) # Make output selectable
|
| 316 |
|
| 317 |
# This function is called when the button is clicked
|