Spaces:
Running
on
Zero
Running
on
Zero
ai-forever
commited on
Commit
•
f6ff9e4
1
Parent(s):
88f3cf2
back to beautify_prompt
Browse files
app.py
CHANGED
@@ -162,14 +162,14 @@ with gr.Blocks() as demo:
|
|
162 |
|
163 |
# image.upload(fn=resize_image, inputs=image, outputs=image, queue=False)
|
164 |
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
# def enhance_prompt_func(prompt):
|
169 |
-
# return beautify_prompt(prompt, max_attempts=5)
|
170 |
|
171 |
def enhance_prompt_func(prompt):
|
172 |
-
return
|
|
|
|
|
|
|
173 |
|
174 |
# if not os.environ.get("OPENAI_API_KEY"):
|
175 |
# return prompt
|
|
|
162 |
|
163 |
# image.upload(fn=resize_image, inputs=image, outputs=image, queue=False)
|
164 |
|
165 |
+
def beautify_prompt(prompt: str, max_attempts: int = 5) -> str:
|
166 |
+
prompt = giga_generate(prompt, max_attempts=max_attempts)
|
|
|
|
|
|
|
167 |
|
168 |
def enhance_prompt_func(prompt):
|
169 |
+
return beautify_prompt(prompt, max_attempts=5)
|
170 |
+
|
171 |
+
# def enhance_prompt_func(prompt):
|
172 |
+
# return giga_generate(prompt, max_attempts=5)
|
173 |
|
174 |
# if not os.environ.get("OPENAI_API_KEY"):
|
175 |
# return prompt
|