Spaces:
				
			
			
	
			
			
		Runtime error
		
	
	
	
			
			
	
	
	
	
		
		
		Runtime error
		
	giga_generate inside enhance_prompt_func
Browse files
    	
        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 | 
         
            -
              # 
     | 
| 166 | 
         
            -
               
     | 
| 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 | 
         
            -
               
     | 
| 201 | 
         
            -
             
     | 
| 202 | 
         
            -
             
     | 
| 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=[
         
     |