Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -133,9 +133,9 @@ def generate_amazon_listing(api_key_input, quote, niche, target, keywords):
|
|
133 |
model = genai.GenerativeModel(
|
134 |
'gemini-1.5-pro', # Or 'gemini-1.5-flash' for potentially faster/cheaper generation
|
135 |
generation_config={
|
136 |
-
"temperature": 0.
|
137 |
-
"top_p": 0.
|
138 |
-
"max_output_tokens":
|
139 |
"response_mime_type": "application/json" # Request JSON directly
|
140 |
}
|
141 |
)
|
@@ -312,7 +312,7 @@ def create_interface():
|
|
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=
|
316 |
|
317 |
# This function is called when the button is clicked
|
318 |
def on_submit(api_key_from_ui, quote, niche, target, keywords):
|
|
|
133 |
model = genai.GenerativeModel(
|
134 |
'gemini-1.5-pro', # Or 'gemini-1.5-flash' for potentially faster/cheaper generation
|
135 |
generation_config={
|
136 |
+
"temperature": 0.2, # Lower temperature for more predictable output
|
137 |
+
"top_p": 0.7,
|
138 |
+
"max_output_tokens": 512, # Maximum tokens the API can *return*
|
139 |
"response_mime_type": "application/json" # Request JSON directly
|
140 |
}
|
141 |
)
|
|
|
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=22, interactive=True) # Make output selectable
|
316 |
|
317 |
# This function is called when the button is clicked
|
318 |
def on_submit(api_key_from_ui, quote, niche, target, keywords):
|