Accelerate documentation

ابدأ من هنا!

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

and get access to the augmented documentation experience

to get started

ابدأ من هنا!

يرجى استخدام الأداة التفاعلية أدناه لمساعدتك على البدء في تعلّم ميزة معينة من Accelerate وكيفية الاستفادة منها! ستوفر لك هذه الأداة فرقًا في الكود (code diff)، وشرحًا لما يحدث، بالإضافة إلى بعض الروابط المفيدة لاستكشاف المزيد داخل التوثيق!

تبدأ معظم أمثلة الأكواد من كود بايثون التالي قبل دمج Accelerate بطريقة ما:

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