mroccuper commited on
Commit
14326d3
·
verified ·
1 Parent(s): 39b3133

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
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
- bullet1 = result.get("bullet_point_1", "")[:BULLET_POINT_MAX_LEN]
174
- bullet2 = result.get("bullet_point_2", "")[:BULLET_POINT_MAX_LEN]
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.4,
218
- "top_p": 0.8,
219
- "max_output_tokens": 1024,
220
  "response_mime_type": "application/json"
221
  }
222
  )
@@ -310,7 +310,7 @@ def create_interface():
310
  )
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
 
 
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", "")[:BULLET_POINT_MAX_LEN]
174
+ #bullet2 = result.get("bullet_point_2", "")[:BULLET_POINT_MAX_LEN]
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.2,
218
+ "top_p": 0.7,
219
+ "max_output_tokens": 512,
220
  "response_mime_type": "application/json"
221
  }
222
  )
 
310
  )
311
  submit_btn = gr.Button("Generate Amazon Listing", variant="primary")
312
 
313
+ with gr.Column(scale=1):
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