Spaces:
				
			
			
	
			
			
		Runtime error
		
	
	
	
			
			
	
	
	
	
		
		
		Runtime error
		
	Commit 
							
							·
						
						3e5a852
	
1
								Parent(s):
							
							db424a8
								
update space
Browse files
    	
        app.py
    CHANGED
    
    | @@ -59,6 +59,7 @@ class Blocks(gr.Blocks): | |
| 59 | 
             
                        config[k] = v
         | 
| 60 |  | 
| 61 | 
             
                    return config
         | 
|  | |
| 62 | 
             
            @torch.no_grad()
         | 
| 63 | 
             
            def optimize_all(xm, models, initial_noise, noise_start_t, diffusion, latent_model, device, prompt, instruction, rand_seed):
         | 
| 64 | 
             
                state = {}
         | 
| @@ -273,8 +274,11 @@ def main(): | |
| 273 | 
             
                }
         | 
| 274 | 
             
                """
         | 
| 275 | 
             
                device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
         | 
|  | |
| 276 | 
             
                latent_model = load_model('text300M', device=device)
         | 
|  | |
| 277 | 
             
                xm = load_model('transmitter', device=device)
         | 
|  | |
| 278 | 
             
                diffusion = diffusion_from_config(load_config('diffusion'))
         | 
| 279 | 
             
                freeze_params(xm.parameters())
         | 
| 280 | 
             
                models = dict()
         | 
|  | |
| 59 | 
             
                        config[k] = v
         | 
| 60 |  | 
| 61 | 
             
                    return config
         | 
| 62 | 
            +
             | 
| 63 | 
             
            @torch.no_grad()
         | 
| 64 | 
             
            def optimize_all(xm, models, initial_noise, noise_start_t, diffusion, latent_model, device, prompt, instruction, rand_seed):
         | 
| 65 | 
             
                state = {}
         | 
|  | |
| 274 | 
             
                }
         | 
| 275 | 
             
                """
         | 
| 276 | 
             
                device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
         | 
| 277 | 
            +
                print("device:", device)
         | 
| 278 | 
             
                latent_model = load_model('text300M', device=device)
         | 
| 279 | 
            +
                print("loaded latent model")
         | 
| 280 | 
             
                xm = load_model('transmitter', device=device)
         | 
| 281 | 
            +
                print("loaded transmitter")
         | 
| 282 | 
             
                diffusion = diffusion_from_config(load_config('diffusion'))
         | 
| 283 | 
             
                freeze_params(xm.parameters())
         | 
| 284 | 
             
                models = dict()
         |