Accelerate documentation

Buradan Başlayın!

You are viewing main version, which requires installation from source. If you'd like regular pip install, checkout the latest stable version (v1.15.0).
Hugging Face's logo
Join the Hugging Face community

and get access to the augmented documentation experience

to get started

Buradan Başlayın!

Belirli bir Accelerate özelliğini öğrenmeye başlamanıza ve bu özelliği nasıl kullanacağınızı anlamanıza yardımcı olması için lütfen aşağıdaki interaktif aracı kullanın! Bu araç, size bir kod farkı (code diff), ne olduğunu açıklayan bir açıklama ve dokümantasyon içinde daha fazla keşfetmeniz için bazı faydalı bağlantılar sağlayacaktır!

Çoğu kod örneği, Accelerate'yi bir şekilde entegre etmeden önce aşağıdaki python kodundan başlar:

for batch in dataloader:
    optimizer.zero_grad()
    inputs, targets = batch
    inputs = inputs.to(device)
    targets = targets.to(device)
    outputs = model(inputs)
    loss = loss_function(outputs, targets)
    loss.backward()
    optimizer.step()
    scheduler.step()
Update on GitHub