mirror of
				https://github.com/rasbt/LLMs-from-scratch.git
				synced 2025-10-30 17:29:59 +00:00 
			
		
		
		
	fix move model to device before calculating loss
This commit is contained in:
		
							parent
							
								
									e4227c899b
								
							
						
					
					
						commit
						d2410cb0c6
					
				| @ -425,6 +425,7 @@ | ||||
|     "\n", | ||||
|     "torch.manual_seed(123)\n", | ||||
|     "model = GPTModel(GPT_CONFIG_124M)\n", | ||||
|     "model.to(device)\n", | ||||
|     "\n", | ||||
|     "loss = calc_loss_batch(input_batch, target_batch, model, device)\n", | ||||
|     "loss.backward()" | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 DrCesar
						DrCesar