ai-forever commited on
Commit
88f3cf2
1 Parent(s): cd7a834

giga_generate inside enhance_prompt_func

Browse files
Files changed (1) hide show
  1. app.py +10 -7
app.py CHANGED
@@ -162,10 +162,14 @@ with gr.Blocks() as demo:
162
 
163
  # image.upload(fn=resize_image, inputs=image, outputs=image, queue=False)
164
 
165
- #TODO изменить под гигачат
166
- def beautify_prompt(prompt: str, retry_times: int = 3) -> str:
167
- prompt = giga_generate(prompt, max_attempts=5)
168
 
 
 
 
 
 
169
 
170
  # if not os.environ.get("OPENAI_API_KEY"):
171
  # return prompt
@@ -197,10 +201,9 @@ with gr.Blocks() as demo:
197
 
198
 
199
  generate_btn.click(fn=sample, inputs=[prompt, resolution], outputs=[video], api_name="video")
200
- #TODO
201
- def enhance_prompt_func(prompt):
202
- return beautify_prompt(prompt, retry_times=1)
203
- #TODO
204
  enhance_button.click(enhance_prompt_func, inputs=[prompt], outputs=[prompt])
205
  # gr.Examples(
206
  # examples=[
 
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
 
201
 
202
 
203
  generate_btn.click(fn=sample, inputs=[prompt, resolution], outputs=[video], api_name="video")
204
+
205
+
206
+
 
207
  enhance_button.click(enhance_prompt_func, inputs=[prompt], outputs=[prompt])
208
  # gr.Examples(
209
  # examples=[