Buckets:

hf-doc-build/doc / diffusers /main /ar /conceptual /contribution.html
mishig's picture
download
raw
141 kB
<meta charset="utf-8" /><meta name="hf:doc:metadata" content="{&quot;title&quot;:&quot;كيفية المساهمة في Diffusers 🧨&quot;,&quot;local&quot;:&quot;how-to-contribute-to-diffusers-&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;نظرة عامة&quot;,&quot;local&quot;:&quot;overview&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;1. طرح الأسئلة والإجابة عنها في GitHub Discussions أو على Discord&quot;,&quot;local&quot;:&quot;1-asking-and-answering-questions-on-github-discussions-or-on-discord&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;2. فتح مشاكل جديدة على تبويب المشاكل في GitHub&quot;,&quot;local&quot;:&quot;2-opening-new-issues-on-the-github-issues-tab&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;2.1. تقارير أخطاء قابلة للتكرار وأدنى حد&quot;,&quot;local&quot;:&quot;21-reproducible-minimal-bug-reports&quot;,&quot;sections&quot;:[],&quot;depth&quot;:4},{&quot;title&quot;:&quot;2.2. طلبات الميزات&quot;,&quot;local&quot;:&quot;22-feature-requests&quot;,&quot;sections&quot;:[],&quot;depth&quot;:4},{&quot;title&quot;:&quot;2.3 الملاحظات&quot;,&quot;local&quot;:&quot;23-feedback&quot;,&quot;sections&quot;:[],&quot;depth&quot;:4},{&quot;title&quot;:&quot;2.4 أسئلة تقنية&quot;,&quot;local&quot;:&quot;24-technical-questions&quot;,&quot;sections&quot;:[],&quot;depth&quot;:4},{&quot;title&quot;:&quot;2.5 اقتراح إضافة نموذج أو مجدول أو خط أنابيب جديد&quot;,&quot;local&quot;:&quot;25-proposal-to-add-a-new-model-scheduler-or-pipeline&quot;,&quot;sections&quot;:[],&quot;depth&quot;:4}],&quot;depth&quot;:3},{&quot;title&quot;:&quot;3. الرد على المشكلات في تبويب المشكلات على GitHub&quot;,&quot;local&quot;:&quot;3-answering-issues-on-the-github-issues-tab&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;4. إصلاح مشكلة “جيدة للمبتدئين”&quot;,&quot;local&quot;:&quot;4-fixing-a-good-first-issue&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;5. المساهمة في التوثيق&quot;,&quot;local&quot;:&quot;5-contribute-to-the-documentation&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;6. نشر خط أنابيب أو نموذج على الـ Hub&quot;,&quot;local&quot;:&quot;6-publish-a-pipeline-or-model-on-the-hub&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;7. المساهمة في أمثلة التدريب&quot;,&quot;local&quot;:&quot;7-contribute-to-training-examples&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;8. إصلاح مشكلة “جيدة من الدرجة الثانية”&quot;,&quot;local&quot;:&quot;8-fixing-a-good-second-issue&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;9. التعامل مع مشكلة MVP في Diffusers&quot;,&quot;local&quot;:&quot;9-taking-on-a-diffusers-mvp-issue&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;10. إضافة خطوط الأنابيب والنماذج والمجدول&quot;,&quot;local&quot;:&quot;10-adding-pipelines-models-schedulers&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;عند إصدار دعم لنموذج أو خط أنابيب جديد&quot;,&quot;local&quot;:&quot;when-new-model-or-pipeline-support-is-released&quot;,&quot;sections&quot;:[],&quot;depth&quot;:4},{&quot;title&quot;:&quot;تم النسخ من mechanism&quot;,&quot;local&quot;:&quot;copied-from-mechanism&quot;,&quot;sections&quot;:[],&quot;depth&quot;:4}],&quot;depth&quot;:3}],&quot;depth&quot;:2},{&quot;title&quot;:&quot;كيفية كتابة مشكلة جيدة&quot;,&quot;local&quot;:&quot;how-to-write-a-good-issue&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;كيفية كتابة طلب دمج جيد&quot;,&quot;local&quot;:&quot;how-to-write-a-good-pr&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;كيفية فتح طلب دمج&quot;,&quot;local&quot;:&quot;how-to-open-a-pr&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;الاختبارات&quot;,&quot;local&quot;:&quot;tests&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;مزامنة الفرع الرئيسي المنفصل مع الفرع الرئيسي في المصدر (HuggingFace)&quot;,&quot;local&quot;:&quot;syncing-forked-main-with-upstream-huggingface-main&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;دليل الأسلوب&quot;,&quot;local&quot;:&quot;style-guide&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3}],&quot;depth&quot;:2},{&quot;title&quot;:&quot;البرمجة باستخدام وكلاء الذكاء الاصطناعي&quot;,&quot;local&quot;:&quot;coding-with-ai-agents&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;المساهمات بمساعدة الذكاء الاصطناعي والوكيلية&quot;,&quot;local&quot;:&quot;ai-assisted-and-agentic-contributions&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3}],&quot;depth&quot;:2}],&quot;depth&quot;:1}"/>
<link href="/docs/diffusers/main/en/_app/immutable/entry/start.D3LnKZ4R.js" rel="modulepreload">
<link href="/docs/diffusers/main/en/_app/immutable/chunks/BF9UNEM9.js" rel="modulepreload">
<link href="/docs/diffusers/main/en/_app/immutable/chunks/DPnyVmXs.js" rel="modulepreload">
<link href="/docs/diffusers/main/en/_app/immutable/entry/app.C0rBoMxR.js" rel="modulepreload">
<link href="/docs/diffusers/main/en/_app/immutable/chunks/DSGUT_OW.js" rel="modulepreload">
<link href="/docs/diffusers/main/en/_app/immutable/chunks/C045MWWx.js" rel="modulepreload">
<link href="/docs/diffusers/main/en/_app/immutable/chunks/DnVIJfC5.js" rel="modulepreload">
<link href="/docs/diffusers/main/en/_app/immutable/chunks/DsnmJJEf.js" rel="modulepreload">
<link href="/docs/diffusers/main/en/_app/immutable/nodes/0.DTZsP_3B.js" rel="modulepreload">
<link href="/docs/diffusers/main/en/_app/immutable/chunks/IaDvMxLQ.js" rel="modulepreload">
<link href="/docs/diffusers/main/en/_app/immutable/nodes/304.CFrbhytr.js" rel="modulepreload">
<link href="/docs/diffusers/main/en/_app/immutable/chunks/bKdwVYpU.js" rel="modulepreload">
<!--110sasa--><meta name="hf:doc:metadata" content="{&quot;title&quot;:&quot;How to contribute to Diffusers 🧨&quot;,&quot;local&quot;:&quot;how-to-contribute-to-diffusers-&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;Overview&quot;,&quot;local&quot;:&quot;overview&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;1. Asking and answering questions on GitHub Discussions or on Discord&quot;,&quot;local&quot;:&quot;1-asking-and-answering-questions-on-github-discussions-or-on-discord&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;2. Opening new issues on the GitHub issues tab&quot;,&quot;local&quot;:&quot;2-opening-new-issues-on-the-github-issues-tab&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;2.1. Reproducible, minimal bug reports&quot;,&quot;local&quot;:&quot;21-reproducible-minimal-bug-reports&quot;,&quot;sections&quot;:[],&quot;depth&quot;:4},{&quot;title&quot;:&quot;2.2. Feature requests&quot;,&quot;local&quot;:&quot;22-feature-requests&quot;,&quot;sections&quot;:[],&quot;depth&quot;:4},{&quot;title&quot;:&quot;2.3 Feedback&quot;,&quot;local&quot;:&quot;23-feedback&quot;,&quot;sections&quot;:[],&quot;depth&quot;:4},{&quot;title&quot;:&quot;2.4 Technical questions&quot;,&quot;local&quot;:&quot;24-technical-questions&quot;,&quot;sections&quot;:[],&quot;depth&quot;:4},{&quot;title&quot;:&quot;2.5 Proposal to add a new model, scheduler, or pipeline&quot;,&quot;local&quot;:&quot;25-proposal-to-add-a-new-model-scheduler-or-pipeline&quot;,&quot;sections&quot;:[],&quot;depth&quot;:4}],&quot;depth&quot;:3},{&quot;title&quot;:&quot;3. Answering issues on the GitHub issues tab&quot;,&quot;local&quot;:&quot;3-answering-issues-on-the-github-issues-tab&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;4. Fixing a “Good first issue”&quot;,&quot;local&quot;:&quot;4-fixing-a-good-first-issue&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;5. Contribute to the documentation&quot;,&quot;local&quot;:&quot;5-contribute-to-the-documentation&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;6. Publish a pipeline or model on the Hub&quot;,&quot;local&quot;:&quot;6-publish-a-pipeline-or-model-on-the-hub&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;7. Contribute to training examples&quot;,&quot;local&quot;:&quot;7-contribute-to-training-examples&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;8. Fixing a “Good second issue”&quot;,&quot;local&quot;:&quot;8-fixing-a-good-second-issue&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;9. Taking on a Diffusers MVP issue&quot;,&quot;local&quot;:&quot;9-taking-on-a-diffusers-mvp-issue&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;10. Adding pipelines, models, schedulers&quot;,&quot;local&quot;:&quot;10-adding-pipelines-models-schedulers&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;When new model or pipeline support is released&quot;,&quot;local&quot;:&quot;when-new-model-or-pipeline-support-is-released&quot;,&quot;sections&quot;:[],&quot;depth&quot;:4},{&quot;title&quot;:&quot;Copied from mechanism&quot;,&quot;local&quot;:&quot;copied-from-mechanism&quot;,&quot;sections&quot;:[],&quot;depth&quot;:4}],&quot;depth&quot;:3}],&quot;depth&quot;:2},{&quot;title&quot;:&quot;How to write a good issue&quot;,&quot;local&quot;:&quot;how-to-write-a-good-issue&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;How to write a good PR&quot;,&quot;local&quot;:&quot;how-to-write-a-good-pr&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;How to open a PR&quot;,&quot;local&quot;:&quot;how-to-open-a-pr&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;Tests&quot;,&quot;local&quot;:&quot;tests&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;Syncing forked main with upstream (HuggingFace) main&quot;,&quot;local&quot;:&quot;syncing-forked-main-with-upstream-huggingface-main&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;Style guide&quot;,&quot;local&quot;:&quot;style-guide&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3}],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Coding with AI agents&quot;,&quot;local&quot;:&quot;coding-with-ai-agents&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;AI-assisted and agentic contributions&quot;,&quot;local&quot;:&quot;ai-assisted-and-agentic-contributions&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3}],&quot;depth&quot;:2}],&quot;depth&quot;:1}"/><!---->
<link href="/docs/diffusers/main/en/_app/immutable/assets/0.tn0RQdqM.css" rel="modulepreload"> <!--[--><!--[0--><!--[--><!--[0--><!--[--><p></p> <div class="items-center shrink-0 min-w-[100px] max-sm:min-w-[50px] justify-end ml-auto flex" style="float: inline-end; margin-inline-start: 10px; display: inline-flex; position: relative; z-index: 10;"><div dir="ltr" class="inline-flex rounded-md max-sm:rounded-sm"><button class="inline-flex items-center gap-1 h-7 max-sm:h-7 px-2 max-sm:px-1.5 text-sm font-medium text-gray-800 border border-r-0 rounded-l-md max-sm:rounded-l-sm border-gray-200 bg-white hover:shadow-inner dark:border-gray-850 dark:bg-gray-950 dark:text-gray-200 dark:hover:bg-gray-800" aria-live="polite"><span class="inline-flex items-center justify-center rounded-md p-0.5 max-sm:p-0 hover:text-gray-800 dark:hover:text-gray-200"><svg class="sm:size-3.5 size-3" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg><!----></span> <span dir="auto">Copy page</span></button> <button class="inline-flex items-center justify-center w-6 max-sm:w-5 h-7 max-sm:h-7 disabled:pointer-events-none text-sm text-gray-500 hover:text-gray-700 dark:hover:text-white rounded-r-md max-sm:rounded-r-sm border border-l transition border-gray-200 bg-white hover:shadow-inner dark:border-gray-850 dark:bg-gray-950 dark:text-gray-200 dark:hover:bg-gray-800" aria-haspopup="menu" aria-expanded="false" aria-label="Open copy menu"><svg class="transition-transform text-gray-400 overflow-visible sm:size-3.5 size-3 rotate-0" width="1em" height="1em" viewBox="0 0 12 7" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M1 1L6 6L11 1" stroke="currentColor"></path></svg><!----></button></div> <!--[-1--><!--]--></div><!----> <!--[0--><h1 class="relative group"><a id="how-to-contribute-to-diffusers-" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#how-to-contribute-to-diffusers-"><span><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg><!----></span></a> <span><!---->كيفية المساهمة في Diffusers 🧨<!----></span></h1><!--]--><!----> <blockquote class="tip"><p>إذا كنت تستخدم وكيل ذكاء اصطناعي للمساهمة، فتأكد من قراءة قسم <a href="#ai-assisted-and-agentic-contributions">المساهمات بمساعدة الذكاء الاصطناعي والوكلاء</a> للاطلاع على توقعاتنا وإرشاداتنا.</p></blockquote> <p>نحب ❤️ المساهمات من مجتمع المصادر المفتوحة! الجميع مرحب به، وتُقدَّر وتُثمَّن جميع أشكال المشاركة –وليس فقط الكود–. الإجابة على الأسئلة، ومساعدة الآخرين، والتواصل، وتحسين التوثيق كلها ذات قيمة هائلة للمجتمع، فلا تتردد وانضم إلينا إذا كنت مستعدًا لذلك!</p> <p>نشجع الجميع على البدء بالقول 👋 في قناة Discord العامة لدينا. نناقش أحدث الاتجاهات في نماذج الانتشار، ونطرح الأسئلة، ونعرض المشاريع الشخصية، ونساعد بعضنا البعض في المساهمات، أو نجلس فقط للاستمتاع ☕. <a href="https://Discord.gg/G7tWnz98XR"><img alt="Join us on Discord" src="https://img.shields.io/discord/823813159592001537?color=5865F2&amp;logo=discord&amp;logoColor=white"/></a></p> <p>بغضّ النظر عن الطريقة التي تختارها للمساهمة، فإننا نسعى لأن نكون جزءاً من مجتمع مفتوح ومرحّب ولطيف. يرجى قراءة <a href="https://github.com/huggingface/diffusers/blob/main/CODE_OF_CONDUCT.md" rel="nofollow">مدونة السلوك</a> لدينا والالتزام بها أثناء تفاعلاتك. كما ننصحك بالاطلاع على <a href="./ethical_guidelines">المبادئ التوجيهية الأخلاقية</a> التي تُنظّم مشروعنا، ونطلب منك الالتزام بنفس مبادئ الشفافية والمسؤولية.</p> <p>نقدّر بشكل كبير الملاحظات الواردة من المجتمع، لذا لا تتردد في التعبير عن رأيك إذا كنت تعتقد أن لديك ملاحظات قيّمة يمكن أن تساعد في تحسين المكتبة - فكل رسالة وتعليق وقضية وطلب سحب (PR) يُقرأ ويُؤخذ في الاعتبار.</p> <!--[1--><h2 class="relative group"><a id="overview" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#overview"><span><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg><!----></span></a> <span><!---->نظرة عامة<!----></span></h2><!--]--><!----> <p>يمكنك المساهمة بعدة طرق، بدءًا من الإجابة على الأسئلة في القضايا والمناقشات وصولاً إلى إضافة نماذج انتشار جديدة إلى المكتبة الأساسية.</p> <p>فيما يلي، نقدم نظرة عامة على الطرق المختلفة للمساهمة، مرتبة حسب مقدار الالتزام الزمني المطلوب، بترتيب تصاعدي. جميعها قيّمة للمجتمع.</p> <ul><li><ol><li>طرح الأسئلة والإجابة عنها على <a href="https://github.com/huggingface/diffusers/discussions" rel="nofollow">GitHub Discussions</a> أو على <a href="https://discord.gg/G7tWnz98XR" rel="nofollow">Discord</a>.</li></ol></li> <li><ol start="2"><li>فتح قضايا جديدة على <a href="https://github.com/huggingface/diffusers/issues/new/choose" rel="nofollow">تبويب GitHub Issues</a>.</li></ol></li> <li><ol start="3"><li>الرد على المشكلات في <a href="https://github.com/huggingface/diffusers/issues" rel="nofollow">تبويب مشكلات GitHub</a>.</li></ol></li> <li><ol start="4"><li>قم بإصلاح مشكلة بسيطة، مُعلَّمة بوسم “Good first issue”، راجع <a href="https://github.com/huggingface/diffusers/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22" rel="nofollow">هنا</a>.</li></ol></li> <li><ol start="5"><li>ساهم في <a href="https://github.com/huggingface/diffusers/tree/main/docs/source" rel="nofollow">التوثيق</a>.</li></ol></li> <li><ol start="6"><li>انشر خط أنابيب أو نموذجًا على Hub كرمز عن بُعد باستخدام <a href="../modular_diffusers/overview">Modular Diffusers</a>.</li></ol></li> <li><ol start="7"><li>ساهم في <a href="https://github.com/huggingface/diffusers/tree/main/examples" rel="nofollow">الأمثلة</a>.</li></ol></li> <li><ol start="8"><li>عالج مشكلة أكثر صعوبة، مُعلَّمةً بوسم “Good second issue”، راجع <a href="https://github.com/huggingface/diffusers/issues?q=is%3Aopen+is%3Aissue+label%3A%22Good+second+issue%22" rel="nofollow">هنا</a>.</li></ol></li> <li><ol start="9"><li>تولَّ مهمة من <a href="https://github.com/huggingface/diffusers/issues/12635" rel="nofollow">برنامج Diffusers MVP</a>.</li></ol></li> <li><ol start="10"><li>أضف خط أنابيب جديدًا، أو نموذجًا، أو مجدولًا إلى المكتبة. في هذه المساهمة، نعمل عادةً بشكل مباشر مع مؤلفي النموذج؛ وبصفتك مساهمًا في المجتمع، ابدأ على <a href="https://github.com/huggingface/diffusers/issues?q=is%3Aopen+is%3Aissue+label%3A%22New+pipeline%2Fmodel%22" rel="nofollow">“New Pipeline/Model”</a> بدلاً من ذلك. راجع المسائل المفتوحة <a href="https://github.com/huggingface/diffusers/issues?q=is%3Aopen+is%3Aissue+label%3A%22New+scheduler%22" rel="nofollow">“New scheduler”</a>، واقرأ <a href="./philosophy">Design Philosophy</a> أولاً.</li></ol></li></ul> <p>كما ذُكر سابقًا، <strong>جميع المساهمات قيّمة للمجتمع</strong>.
فيما يلي، سنشرح كل مساهمة بتفصيل أكبر قليلًا.</p> <p>بالنسبة للمساهمات من 4 إلى 10، باستثناء 6 التي توجد على Hub، ستحتاج إلى فتح طلب سحب. يتم شرح كيفية القيام بذلك بالتفصيل في <a href="#how-to-open-a-pr">فتح طلب سحب</a>.</p> <!--[2--><h3 class="relative group"><a id="1-asking-and-answering-questions-on-github-discussions-or-on-discord" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#1-asking-and-answering-questions-on-github-discussions-or-on-discord"><span><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg><!----></span></a> <span><!---->1. طرح الأسئلة والإجابة عنها في GitHub Discussions أو على Discord<!----></span></h3><!--]--><!----> <p>يمكن طرح أي سؤال أو تعليق يتعلق بمكتبة Diffusers على <a href="https://github.com/huggingface/diffusers/discussions" rel="nofollow">GitHub Discussions</a> أو على <a href="https://discord.gg/G7tWnz98XR" rel="nofollow">Discord</a>. وتشمل هذه الأسئلة والتعليقات (وليس حصراً):</p> <ul><li>تقارير حول تجارب التدريب أو الاستدلال في محاولة لمشاركة المعرفة</li> <li>عرض المشاريع الشخصية</li> <li>أسئلة حول أمثلة التدريب غير الرسمية</li> <li>اقتراحات المشاريع</li> <li>ملاحظات عامة</li> <li>ملخصات الأوراق</li> <li>طلب المساعدة في المشاريع الشخصية التي تُبنى على مكتبة Diffusers</li> <li>أسئلة عامة</li> <li>أسئلة أخلاقية تتعلق بنماذج الانتشار</li> <li>…</li></ul> <p>كل سؤال يُطرح في GitHub Discussions أو على Discord يشجع المجتمع بنشاط على مشاركة المعرفة علنًا، وقد يساعد في المستقبل مبتدئًا لديه نفس السؤال الذي لديك. يُرجى طرح أي أسئلة قد تكون لديك.
وبنفس الروح، فإنك تقدم مساعدة هائلة للمجتمع من خلال الإجابة على مثل هذه الأسئلة، لأنك بهذه الطريقة توثّق المعرفة علنًا ليتعلم منها الجميع.</p> <p><strong>يرجى</strong> ملاحظة أن الجهد الذي تبذله في طرح سؤال أو الإجابة عنه ينعكس مباشرة على جودة المعرفة الموثقة علنًا. وبالمثل، فإن الأسئلة الصياغة الجيدة والإجابات الدقيقة تُسهم في بناء قاعدة معرفة عالية الجودة متاحة للجميع، بينما تُضعف الأسئلة أو الإجابات الرديئة الجودة العامة لقاعدة المعرفة العامة.
باختصار، السؤال أو الإجابة عالي الجودة يكون <em>دقيقًا</em>، <em>موجزًا</em>، <em>ملائمًا</em>، <em>سهل الفهم</em>، <em>متاحًا</em>، و<em>منسقًا/صياغته جيدة</em>. لمزيد من المعلومات، يرجى الاطلاع على قسم <a href="#how-to-write-a-good-issue">كيف تكتب مشكلة جيدة</a>.</p> <p><strong>ملاحظة حول القنوات</strong>: يُفهرس <a href="https://github.com/huggingface/diffusers/discussions" rel="nofollow"><em>GitHub Discussions</em></a> بواسطة محركات البحث ويمكن ربط كل موضوع، لذا تبقى الأسئلة والإجابات المنشورة هناك قابلة للعثور عليها للشخص التالي الذي يواجه المشكلة نفسها.
في المقابل، يتبع <em>Discord</em> تنسيقًا يشبه الدردشة مما يشجع على التواصل السريع المتبادل.
على الرغم من أن الحصول على إجابة لسؤالك على Discord قد يستغرق وقتًا أقل على الأرجح، إلا أن سؤالك لن يبقى مرئيًا مع مرور الوقت، ويصعب العثور على المعلومات التي نُشرت منذ فترة طويلة. لذلك نوصي باستخدام GitHub Discussions للأسئلة والإجابات المقصود بها أن تدوم. إذا أدّى حوار على Discord إلى نتيجة مثيرة للاهتمام، فأنشئ موضوعًا فيها حتى يتمكن القراء المستقبليون من العثور عليها.</p> <!--[2--><h3 class="relative group"><a id="2-opening-new-issues-on-the-github-issues-tab" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#2-opening-new-issues-on-the-github-issues-tab"><span><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg><!----></span></a> <span><!---->2. فتح مشاكل جديدة على تبويب المشاكل في GitHub<!----></span></h3><!--]--><!----> <p>تتميز مكتبة 🧨 Diffusers بالمتانة والموثوقية بفضل المستخدمين الذين يُبلّغوننا عن المشكلات التي يواجهونها. لذا، شكرًا لكم على الإبلاغ عن المشكلة.</p> <p>تذكّر، أن مشكلات GitHub مخصصة للأسئلة التقنية المرتبطة مباشرةً بمكتبة Diffusers، أو تقارير الأخطاء، أو طلبات الميزات، أو الملاحظات على تصميم المكتبة.</p> <p>باختصار، هذا يعني أن كل ما <strong>لا</strong> يتعلق بـ<strong>كود مكتبة Diffusers</strong> (بما في ذلك التوثيق) يجب <strong>ألا</strong> يُطرح كمشكلة، بل على <a href="https://github.com/huggingface/diffusers/discussions" rel="nofollow">GitHub Discussions</a> أو <a href="https://discord.gg/G7tWnz98XR" rel="nofollow">Discord</a>.</p> <p><strong>يرجى مراعاة الإرشادات التالية عند فتح مشكلة جديدة</strong>:</p> <ul><li>تأكد من أنك بحثت لمعرفة ما إذا كان مشكلتك قد طُرح من قبل (استخدم شريط البحث على GitHub تحت Issues).</li> <li>يرجى عدم الإبلاغ عن مشكلة جديدة ضمن مشكلة أخرى (متعلقة). إذا كانت هناك مشكلة أخرى ذات صلة وثيقة، يرجى فتح مشكلة جديدة على أي حال وربطها بالمشكلة ذات الصلة.</li> <li>تأكد من أن مشكلتك مكتوبة باللغة الإنجليزية.</li> <li>تحقق مما إذا كان بإمكانك حل مشكلتك من خلال التحديث إلى أحدث إصدار من Diffusers. قبل نشر مشكلتك، تأكد من أن <code>python -c "import diffusers; print(diffusers.__version__)"</code> أعلى من أحدث إصدار لـ Diffusers أو يطابقه.</li> <li>تذكر أن كلما بذلت جهدًا أكبر في فتح مشكلة جديدة، ارتفعت جودة إجابتك وتحسّنت الجودة الإجمالية لمشكلات Diffusers.</li></ul> <p>تشمل المشكلات الجديدة عادةً ما يلي.</p> <!--[3--><h4 class="relative group"><a id="21-reproducible-minimal-bug-reports" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#21-reproducible-minimal-bug-reports"><span><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg><!----></span></a> <span><!---->2.1. تقارير أخطاء قابلة للتكرار وأدنى حد<!----></span></h4><!--]--><!----> <p>يجب أن يتضمن تقرير الخطأ دائمًا مقتطفًا من الشيفرة قابلًا للتكرار، وأن يكون بأقل قدر ممكن من التفاصيل وبأكثر إيجاز ممكن.
يعني هذا بالتفصيل:</p> <ul><li>حدّد نطاق الخطأ قدر الإمكان، <strong>لا تكتفِ بإرفاق ملف الكود بأكمله</strong>.</li> <li>قم بتنسيق الكود الخاص بك.</li> <li>لا تتضمن أي مكتبات خارجية باستثناء Diffusers التي تعتمد عليها.</li> <li><strong>دائمًا</strong> قدّم جميع المعلومات الضرورية حول بيئتك؛ ولتحقيق ذلك، يمكنك تشغيل <code>diffusers-cli env</code> في الطرفية ثم نسخ المعلومات المعروضة ولصقها في المشكلة.</li> <li>اشرح المشكلة. إذا لم يكن القارئ على دراية بطبيعة المشكلة وسبب اعتبارها مشكلة، فلن يتمكن من حلها.</li> <li><strong>دائمًا</strong> تأكد من أن القارئ قادر على إعادة إنتاج مشكلتك بأقل جهد ممكن. إذا تعذّر تشغيل مقتطف الكود الخاص بك بسبب غياب مكتبات أو متغيرات غير معرّفة، فلن يتمكن القارئ من مساعدتك. تأكد من أن مقتطف الكود القابل لإعادة الإنتاج هو الأضيق قدر الإمكان ويمكن نسخه ولصقه في واجهة Python بسيطة.</li> <li>إذا كان إعادة إنتاج مشكلتك تتطلب نموذجًا و/أو مجموعة بيانات، فتأكد من أن القارئ لديه وصول إلى ذلك النموذج أو مجموعة البيانات. يمكنك دائمًا رفع نموذجك أو مجموعة بياناتك إلى <a href="https://huggingface.co" rel="nofollow">Hub</a> لجعلها قابلة للتنزيل بسهولة. حاول إبقاء نموذجك ومجموعة بياناتك أصغر ما يمكن، لجعل إعادة إنتاج مشكلتك أسهل ما يمكن.</li></ul> <p>لمزيد من المعلومات، يرجى الاطلاع على قسم <a href="#how-to-write-a-good-issue">كيف تكتب مشكلة جيدة</a>.</p> <p>يمكنك فتح تقرير خطأ <a href="https://github.com/huggingface/diffusers/issues/new?assignees=&amp;labels=bug&amp;projects=&amp;template=bug-report.yml" rel="nofollow">هنا</a>.</p> <!--[3--><h4 class="relative group"><a id="22-feature-requests" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#22-feature-requests"><span><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg><!----></span></a> <span><!---->2.2. طلبات الميزات<!----></span></h4><!--]--><!----> <p>تعتمد طلبات الميزات العالمية على النقاط التالية:</p> <ol><li>الدافع أولاً:</li></ol> <ul><li>هل يرتبط الأمر بمشكلة أو إحباط مع المكتبة؟ إن كان كذلك، يرجى توضيح السبب. يُفضّل تقديم مقتطف من الشيفرة يوضح المشكلة.</li> <li>هل يتعلق بشيء ستحتاجه لمشروع ما؟ يسعدنا أن نسمع منك!</li> <li>هل هو شيء عملت عليه وترى أنه قد يفيد المجتمع؟
رائع! أخبرنا عن المشكلة التي حلتها لك.</li></ul> <ol start="2"><li>اكتب <em>فقرة كاملة</em> تصف الميزة؛</li> <li>قدّم <strong>مقتطف كود</strong> يوضح استخدامه المستقبلي؛</li> <li>في حال كان هذا الأمر متعلقًا ببحث علمي، يرجى إرفاق رابط؛</li> <li>أرفق أي معلومات إضافية (رسومات، لقطات شاشة، إلخ) تعتقد أنها قد تكون مفيدة.</li></ol> <p>يمكنك فتح طلب ميزة <a href="https://github.com/huggingface/diffusers/issues/new?assignees=&amp;labels=&amp;template=feature_request.md&amp;title=" rel="nofollow">هنا</a>.</p> <!--[3--><h4 class="relative group"><a id="23-feedback" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#23-feedback"><span><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg><!----></span></a> <span><!---->2.3 الملاحظات<!----></span></h4><!--]--><!----> <p>يساعد الملاحظات حول تصميم المكتبة ولماذا هو جيد أو غير جيد صانعي المحتوى الأساسيين بشكل كبير في بناء مكتبة سهلة الاستخدام. لفهم الفلسفة الكامنة وراء فلسفة التصميم الحالية، يرجى الاطلاع <a href="./philosophy">هنا</a>. إذا كنت تشعر بأن خيار تصميم معين لا يتوافق مع فلسفة التصميم الحالية، يرجى توضيح السبب وكيفية تغييره. إذا كان خيار تصميم معين يتبع فلسفة التصميم بشكل مفرط، مما يحد من حالات الاستخدام، فوضّح السبب وكيفية تغييره.
إذا كان خيار تصميم معين مفيدًا جدًا لك، يرجى أيضًا ترك ملاحظة، فهذا تغذية راجعة رائعة لقرارات التصميم المستقبلية.</p> <p>يمكنك فتح مشكلة تتعلق بالملاحظات <a href="https://github.com/huggingface/diffusers/issues/new?assignees=&amp;labels=&amp;template=feedback.md&amp;title=" rel="nofollow">هنا</a>.</p> <!--[3--><h4 class="relative group"><a id="24-technical-questions" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#24-technical-questions"><span><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg><!----></span></a> <span><!---->2.4 أسئلة تقنية<!----></span></h4><!--]--><!----> <p>تتعلق الأسئلة التقنية بشكل رئيسي بالسبب وراء كتابة جزء معين من كود المكتبة بطريقة معينة، أو بما يفعله جزء محدد من الكود. يرجى التأكد من تضمين رابط إلى الكود المعني، وتقديم تفاصيل حول سبب صعوبة فهم هذا الجزء من الكود.</p> <p>يمكنك فتح مشكلة تتعلق بسؤال تقني <a href="https://github.com/huggingface/diffusers/issues/new?assignees=&amp;labels=bug&amp;template=bug-report.yml" rel="nofollow">هنا</a>.</p> <!--[3--><h4 class="relative group"><a id="25-proposal-to-add-a-new-model-scheduler-or-pipeline" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#25-proposal-to-add-a-new-model-scheduler-or-pipeline"><span><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg><!----></span></a> <span><!---->2.5 اقتراح إضافة نموذج أو مجدول أو خط أنابيب جديد<!----></span></h4><!--]--><!----> <p>إذا أصدر مجتمع نماذج الانتشار نموذجًا أو خط أنابيب أو مجدولًا جديدًا ترغب في رؤيته في مكتبة Diffusers، يرجى تقديم المعلومات التالية:</p> <ul><li>وصف موجز لخط أنابيب الانتشار أو النموذج أو المجدول، مع رابط إلى الورقة البحثية أو الإصدار العام.</li> <li>رابط إلى أيٍّ من تطبيقاته مفتوحة المصدر.</li> <li>رابط إلى أوزان النموذج إذا كانت متاحة.</li></ul> <p>كما لا تنسَ الإشارة إلى المؤلف الأصلي للمكوّن (النموذج، المجدول، خط الأنابيب، إلخ) عبر اسم المستخدم على GitHub إن أمكنك العثور عليه.</p> <p>إذا كنت ترغب في إضافة النموذج إلى Diffusers بنفسك، فراجع <a href="#6-publish-a-pipeline-or-model-on-the-hub">نشر خط أنابيب أو نموذج على Hub</a> و<a href="#10-adding-pipelines-models-schedulers">إضافة خطوط أنابيب ونماذج ومجدولات</a>.</p> <p>يمكنك فتح طلب لنموذج/خط أنابيب/مجدول <a href="https://github.com/huggingface/diffusers/issues/new?assignees=&amp;labels=New+model%2Fpipeline%2Fscheduler&amp;template=new-model-addition.yml" rel="nofollow">هنا</a>.</p> <!--[2--><h3 class="relative group"><a id="3-answering-issues-on-the-github-issues-tab" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#3-answering-issues-on-the-github-issues-tab"><span><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg><!----></span></a> <span><!---->3. الرد على المشكلات في تبويب المشكلات على GitHub<!----></span></h3><!--]--><!----> <p>قد يتطلب الرد على المشكلات في GitHub بعض المعرفة التقنية بـ Diffusers، لكننا نشجع الجميع على المحاولة حتى لو لم تكن متأكدًا بنسبة 100% من صحة إجابتك.
بعض النصائح لتقديم إجابة عالية الجودة على مشكلة:</p> <ul><li>كن موجزًا وأقل ما يمكن.</li> <li>التزم بالموضوع. يجب أن يقتصر الرد على المشكلة على المشكلة فقط.</li> <li>قدّم روابط إلى الأكواد أو الأوراق البحثية أو المصادر الأخرى التي تثبت أو تدعم وجهة نظرك.</li> <li>أجب بالكود. إذا كان مقتطف كود بسيط هو الإجابة على المشكلة أو يُظهر كيفية حلها، يرجى تقديم مقتطف كود قابل للتكرار بالكامل.</li></ul> <p>كما أن العديد من المشكلات تميل إلى أن تكون خارج الموضوع، أو مكررة لمشكلات أخرى، أو غير ذات صلة. سيكون من المفيد للغاية للمحافظين على المشروع إذا استطعت الإجابة على مثل هذه المشكلات، بتشجيع كاتب المشكلة على أن يكون أكثر دقة، أو تقديم رابط إلى المشكلة المكررة، أو تحويله إلى <a href="https://github.com/huggingface/diffusers/discussions" rel="nofollow">GitHub Discussions</a> أو <a href="https://discord.gg/G7tWnz98XR" rel="nofollow">Discord</a>.</p> <p>إذا كنت قد تأكدت من أن تقرير الخطأ المُصدر صحيح ويتطلب إجراء تصحيح في الشيفرة المصدرية،
فيُرجى الاطلاع على الأقسام التالية.</p> <p>بالنسبة لجميع المساهمات، باستثناء <a href="#6-publish-a-pipeline-or-model-on-the-hub">6</a>، تحتاج إلى فتح طلب سحب. يشرح قسم <a href="https://github.com/huggingface/diffusers/pull/15179/changes#how-to-open-a-pr" rel="nofollow">فتح طلب سحب</a> كيفية القيام بذلك.</p> <!--[2--><h3 class="relative group"><a id="4-fixing-a-good-first-issue" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#4-fixing-a-good-first-issue"><span><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg><!----></span></a> <span><!---->4. إصلاح مشكلة “جيدة للمبتدئين”<!----></span></h3><!--]--><!----> <p>يتم تحديد <em>المشكلات الجيدة للمبتدئين</em> بوسم <a href="https://github.com/huggingface/diffusers/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22" rel="nofollow">مشكلة جيدة للمبتدئين</a>. وعادةً ما يشرح الوصف كيفية مظهر الحل المقترح لتسهيل عملية الإصلاح. إذا لم تُغلق المشكلة بعد وترغب في محاولة إصلاحها، يمكنك ببساطة ترك رسالة تقول “أود محاولة معالجة هذه المشكلة”. وعادةً ما تكون هناك ثلاثة سيناريوهات:</p> <ul><li>أ.) يقدّم وصف المشكلة بالفعل إصلاحًا مقترحًا. في هذه الحالة، وإذا كان الحل منطقيًا بالنسبة لك، يمكنك فتح طلب سحب (PR) أو طلب سحب مسودة (draft PR) لإصلاحه.</li> <li>ب.) لا يقترح وصف المشكلة إصلاحًا. في هذه الحالة، اقترح إصلاحًا بنفسك في تعليق على المشكلة. يكفي بضع جمل تصف النهج. انتظر حتى يؤكد أحد أعضاء فريق Diffusers ذلك قبل فتح طلب سحب (PR).</li> <li>c.) يوجد بالفعل طلب سحب مفتوح لإصلاح المشكلة، لكن المشكلة لم تُغلق بعد. إذا أصبح طلب السحب قديمًا، يمكنك ببساطة فتح طلب سحب جديد وربطه بطلب السحب القديم. غالبًا ما تصبح طلبات السحب قديمة إذا لم يعد المساهم الأصلي الذي أراد إصلاح المشكلة قادرًا على إيجاد الوقت للمتابعة. يحدث هذا كثيرًا في المشاريع مفتوحة المصدر وهو أمر طبيعي جدًا. في هذه الحالة، سيكون المجتمع سعيدًا جدًا إذا حاولت مرة أخرى واستفدت من المعرفة الموجودة في طلب السحب الحالي. إذا كان هناك طلب سحب بالفعل وهو نشط، يمكنك مساعدة المؤلف بتقديم اقتراحات، أو مراجعة طلب السحب، أو حتى السؤال عما إذا كان بإمكانك المساهمة في طلب السحب.</li></ul> <!--[2--><h3 class="relative group"><a id="5-contribute-to-the-documentation" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#5-contribute-to-the-documentation"><span><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg><!----></span></a> <span><!---->5. المساهمة في التوثيق<!----></span></h3><!--]--><!----> <p>المكتبة الجيدة <strong>دائمًا</strong> تمتاز بتوثيق جيد! غالبًا ما يُعد التوثيق الرسمي من أوائل نقاط التفاعل للمستخدمين الجدد للمكتبة، ولذلك فإن المساهمة في التوثيق تُعد <strong>مساهمة ذات قيمة عالية</strong>.</p> <p>يمكن أن يتخذ المساهمة في المكتبة أشكالاً متعددة:</p> <ul><li>تصحيح الأخطاء الإملائية أو النحوية.</li> <li>صحّح التنسيق غير الصحيح لسطر التوثيق. إذا لاحظت أن التوثيق الرسمي يظهر بشكل غير طبيعي أو أن رابطًا ما مكسور، فسيسعدنا كثيرًا أن تخصص بعض الوقت لتصحيحه.</li> <li>صحّح الشكل أو الأبعاد لمُدخل أو مُخرَج متجه في توثيق الدالة.</li> <li>وضّح التوثيق الذي يصعب فهمه أو يحتوي على أخطاء.</li> <li>تحديث أمثلة الأكواد القديمة.</li> <li>ترجمة التوثيق إلى لغة أخرى.</li></ul> <p>كل ما يظهر على <a href="../index">صفحة مستندات Diffusers الرسمية</a> هو جزء من التوثيق الرسمي ويمكن تصحيحه أو تعديله في <a href="https://github.com/huggingface/diffusers/tree/main/docs/source" rel="nofollow">مصدر التوثيق</a> المعني.</p> <p>يرجى الاطلاع على <a href="https://github.com/huggingface/diffusers/tree/main/docs" rel="nofollow">هذه الصفحة</a> حول كيفية التحقق من التغييرات المُجراة على التوثيق محليًا.</p> <!--[2--><h3 class="relative group"><a id="6-publish-a-pipeline-or-model-on-the-hub" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#6-publish-a-pipeline-or-model-on-the-hub"><span><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg><!----></span></a> <span><!---->6. نشر خط أنابيب أو نموذج على الـ Hub<!----></span></h3><!--]--><!----> <p>مع <a href="../modular_diffusers/overview">Modular Diffusers</a>، يمكن أن يعيش خط أنابيب ككود عن بُعد في أي مستودع على Hub. يمكن لأي شخص تحميله باستخدام <code>from_pretrained(..., trust_remote_code=True)</code>، دون انتظار إصدار جديد من Diffusers. إذا كنت مساهماً في المجتمع تقدم خط أنابيب أو نموذجاً جديداً، فابدأ من هنا. راجع custom blocks لنشر خط أنابيب وcustom models لنشر نموذج.</p> <p>أخبرونا تحت <a href="https://github.com/huggingface/diffusers/issues/new?assignees=&amp;labels=New+model%2Fpipeline%2Fscheduler&amp;template=new-model-addition.yml" rel="nofollow">طلب النموذج</a> المطابق (افتحوا طلباً جديداً إن لم يوجد): نقدم ملاحظاتنا حول التنفيذ ونُبرز النسخ التي نفضلها في مجموعة <a href="https://huggingface.co/collections/diffusers-modular/community-modular-diffusers-blocks" rel="nofollow">Community Modular Diffusers Blocks</a>. ومن هناك نقرر كيفية دعم النموذج في المكتبة: قد ندمج نسختكم في النسخة الرئيسية، أو نعمل مع المؤلفين على نسخة رسمية، أو نوجّه المستخدمين ببساطة إلى نسختكم. أخبرونا أيضاً عن أي عقبات واجهتموها على طول الطريق: واجهات برمجة تطبيقات مربكة، توثيق ناقص، أخطاء برمجية. تلك الملاحظات ذات قيمة لدينا بقدر قيمة خط الأنابيب نفسه.</p> <!--[2--><h3 class="relative group"><a id="7-contribute-to-training-examples" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#7-contribute-to-training-examples"><span><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg><!----></span></a> <span><!---->7. المساهمة في أمثلة التدريب<!----></span></h3><!--]--><!----> <p>أمثلة Diffusers هي مجموعة من سكربتات التدريب الموجودة في <a href="https://github.com/huggingface/diffusers/tree/main/examples" rel="nofollow">examples</a>.</p> <p>ندعم نوعين من أمثلة التدريب:</p> <ul><li>أمثلة التدريب الرسمية</li> <li>أمثلة تدريب البحث</li></ul> <p>تقع أمثلة التدريب البحثية في <a href="https://github.com/huggingface/diffusers/tree/main/examples/research_projects" rel="nofollow">examples/research_projects</a> بينما تشمل أمثلة التدريب الرسمية جميع المجلدات الموجودة تحت <a href="https://github.com/huggingface/diffusers/tree/main/examples" rel="nofollow">examples</a> باستثناء مجلدي <code>research_projects</code> و<code>community</code>.
يتم صيانة أمثلة التدريب الرسمية من قبل صانعي Diffusers الأساسيين، بينما يتم صيانة أمثلة التدريب البحثية من قبل المجتمع.
والسبب في ذلك هو نفس السبب الذي يجعل المكتبة تحافظ على مجموعة صغيرة من خطوط الأنابيب الرسمية وخطوط الأنابيب المجتمعية نشطة على Hub: فليس من الممكن لصانعي الأساسيين صيانة جميع طرق التدريب الممكنة لنماذج الانتشار.
إذا اعتبر صانعو Diffusers الأساسيون والمجتمع أن نهج تدريب معين تجريبي للغاية أو غير شائع بما يكفي، فيجب وضع كود التدريب المقابل في مجلد <code>research_projects</code> وصيانته من قبل المؤلف.</p> <p>تتكون أمثلة التدريب والبحث الرسمية من مجلد يحتوي على سكربت تدريب واحد أو أكثر، وملف <code>requirements.txt</code>، وملف <code>README.md</code>. ولكي يتمكن المستخدم من الاستفادة من أمثلة التدريب، يجب استنساخ المستودع:</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg><!----> <div class=" absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0 "><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent;"></div> تم النسخ</div><!----></button><!----></div> <pre class="language-bash "><!---->git <span class="hljs-built_in">clone</span> https://github.com/huggingface/diffusers<!----></pre></div><!----> <p>وكذلك لتثبيت جميع التبعيات الإضافية المطلوبة للتدريب:</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg><!----> <div class=" absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0 "><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent;"></div> تم النسخ</div><!----></button><!----></div> <pre class="language-bash "><!----><span class="hljs-built_in">cd</span> diffusers
pip install -r examples/&lt;your-example-folder&gt;/requirements.txt<!----></pre></div><!----> <p>لذلك، عند إضافة مثال، يجب أن يحدد ملف <code>requirements.txt</code> جميع تبعيات pip المطلوبة لمثال التدريب الخاص بك، بحيث يمكن للمستخدم تشغيل سكربت تدريب المثال بعد تثبيت جميع تلك التبعيات. راجع، على سبيل المثال، <a href="https://github.com/huggingface/diffusers/blob/main/examples/dreambooth/requirements.txt" rel="nofollow">ملف <code>requirements.txt</code> الخاص بـ DreamBooth</a>.</p> <p>يجب أن تلتزم أمثلة التدريب في مكتبة Diffusers بالفلسفة التالية:</p> <ul><li>يجب أن يكون كل الكود اللازم لتشغيل الأمثلة موجودًا في ملف Python واحد.</li> <li>يجب أن يكون بإمكان المرء تشغيل المثال من سطر الأوامر باستخدام <code>python &lt;your-example>.py --args</code>.</li> <li>يجب أن تبقى الأمثلة بسيطة وتعمل كـ<strong>مثال</strong> على كيفية استخدام Diffusers للتدريب. الغرض من سكريبتات الأمثلة ليس <strong>إنشاء</strong> نماذج انتشار متطورة، بل إعادة إنتاج مخططات التدريب المعروفة دون إضافة الكثير من المنطق المخصص. وكنتيجة ثانوية لهذا المبدأ، تسعى أمثلتنا أيضاً إلى أن تكون مواد تعليمية جيدة.</li></ul> <p>لمساهمة مثال، يُوصى بشدة بالاطلاع على الأمثلة الموجودة مسبقًا مثل <a href="https://github.com/huggingface/diffusers/blob/main/examples/dreambooth/train_dreambooth.py" rel="nofollow">dreambooth</a> للحصول على فكرة عن الشكل الذي يجب أن تكون عليه.
ننصح المساهمين بقوة باستخدام <a href="https://github.com/huggingface/accelerate" rel="nofollow">مكتبة Accelerate</a> لأنها متكاملة بشكل وثيق مع Diffusers.
بمجرد أن يعمل سكريبت المثال، يرجى التأكد من إضافة <code>README.md</code> شامل يوضح كيفية استخدام المثال بالضبط. يجب أن يتضمن هذا الملف:</p> <ul><li>مثال على أمر لتشغيل السكربت التجريبي كما هو موضح <a href="https://github.com/huggingface/diffusers/tree/main/examples/dreambooth#running-locally-with-pytorch" rel="nofollow">هنا</a>.</li> <li>رابط إلى بعض نتائج التدريب (السجلات، النماذج، إلخ) تُظهر ما يمكن للمستخدم توقعه كما هو موضح <a href="https://api.wandb.ai/report/patrickvonplaten/xm6cd5q5" rel="nofollow">هنا</a>.</li> <li>إذا كنت تضيف مثال تدريب غير رسمي/بحثي، <strong>يرجى عدم نسيان</strong> إضافة جملة تفيد أنك المسؤول عن صيانة هذا المثال التدريبي، مع تضمين اسم حسابك على git كما هو موضح <a href="https://github.com/huggingface/diffusers/tree/main/examples/research_projects/intel_opts#diffusers-examples-with-intel-optimizations" rel="nofollow">هنا</a>.</li></ul> <p>إذا كنت تساهم في أمثلة التدريب الرسمية، فتأكد أيضًا من إضافة اختبار إلى مجلدها، مثل <a href="https://github.com/huggingface/diffusers/blob/main/examples/dreambooth/test_dreambooth.py" rel="nofollow">examples/dreambooth/test_dreambooth.py</a>. هذا ليس ضروريًا لأمثلة التدريب غير الرسمية.</p> <!--[2--><h3 class="relative group"><a id="8-fixing-a-good-second-issue" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#8-fixing-a-good-second-issue"><span><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg><!----></span></a> <span><!---->8. إصلاح مشكلة “جيدة من الدرجة الثانية”<!----></span></h3><!--]--><!----> <p>تُوسم <em>المشكلات الجيدة الثانية</em> بوسم <a href="https://github.com/huggingface/diffusers/issues?q=is%3Aopen+is%3Aissue+label%3A%22Good+second+issue%22" rel="nofollow">مشكلة جيدة ثانية</a>. وعادةً ما تكون أكثر تعقيدًا في الحل من <a href="https://github.com/huggingface/diffusers/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22" rel="nofollow">المشكلات الجيدة الأولى</a>، حيث تمنح الوصف إرشادات أقل حول الإصلاح، وتتطلب فهمًا كافيًا للمكتبة.</p> <p>إذا كنت مهتمًا بالتعامل مع مشكلة ثانية جيدة، فشارك رأيك في المشكلة والمنهجية التي تنوي اتباعها كتعليق، في بضع جمل، واحصل على موافقة من أحد المشرفين قبل فتح طلب الدمج. إذا كان قد تم فتح طلب دمج بالفعل للمشكلة لكن لم يتم دمجه، فتأكد من فهم السبب قبل اقتراح شيء جديد.</p> <!--[2--><h3 class="relative group"><a id="9-taking-on-a-diffusers-mvp-issue" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#9-taking-on-a-diffusers-mvp-issue"><span><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg><!----></span></a> <span><!---->9. التعامل مع مشكلة MVP في Diffusers<!----></span></h3><!--]--><!----> <p>يُدرج برنامج <a href="https://github.com/huggingface/diffusers/issues/12635" rel="nofollow">Diffusers MVP</a> المشكلات التي نرغب فيها أكثر في الحصول على المساعدة. تعمل هذه المشكلات مثل مشكلات "Good second issues"، لكنها أصعب وتستغرق وقتًا أطول، ويكافئ البرنامج المساهمين الذين يتولون معالجتها. شارك مقاربتك كتعليق أولاً واحصل على تأكيد من أحد المشرفين قبل فتح طلب الإرسال. كما يتضمن البرنامج مسار <a href="https://github.com/huggingface/diffusers/issues/14529" rel="nofollow">الأفكار</a>: أخبرنا بفكرة واحدة ستزيد من تأثير Diffusers، في بضع جمل وبدون تفاصيل التنفيذ.</p> <!--[2--><h3 class="relative group"><a id="10-adding-pipelines-models-schedulers" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#10-adding-pipelines-models-schedulers"><span><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg><!----></span></a> <span><!---->10. إضافة خطوط الأنابيب والنماذج والمجدول<!----></span></h3><!--]--><!----> <blockquote class="tip"><p>إذا كنت مؤلف النموذج، يرجى التواصل معنا حتى نتمكن من تنسيق عملية الدمج معك: افتح طلب ميزة، أو أضف تعليقًا إذا كان هناك طلب مفتوح بالفعل.</p> <p>إذا كنت مساهماً في المجتمع، فابدأ أولاً بإنشاء مستودع على Hub، راجع <a href="#6-publish-a-pipeline-or-model-on-the-hub">نشر خط أنابيب أو نموذج على Hub</a>، وأخبرنا في طلب الميزة أنك مهتم بدمجها في المشروع الرئيسي.</p></blockquote> <p>تُعد خطوط الأنابيب والنماذج ومجدولات الوقت أهم مكونات مكتبة Diffusers.
توفر وصولاً سهلاً إلى تقنيات الانتشار الرائدة، مما يتيح للمجتمع بناء تطبيقات ذكاء اصطناعي توليدي قوية.</p> <p>من خلال إضافة نموذج أو خط أنابيب أو مجدول جديد، قد تتيح سيناريو استخدام جديدًا وقويًا لأي من واجهات المستخدم التي تعتمد على Diffusers، مما قد يكون ذا قيمة هائلة للنظام البيئي بأكمله للذكاء الاصطناعي التوليدي.</p> <!--[3--><h4 class="relative group"><a id="when-new-model-or-pipeline-support-is-released" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#when-new-model-or-pipeline-support-is-released"><span><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg><!----></span></a> <span><!---->عند إصدار دعم لنموذج أو خط أنابيب جديد<!----></span></h4><!--]--><!----> <p>قد يُضمَّن نموذج أو خط أنابيب جديد في إصدار ما إذا قمت بتنسيق عملية الدمج مع فريق Diffusers مسبقًا. لا تتردد في التواصل معنا، إما عبر فتح مشكلة (issue) في مستودع Diffusers أو عبر إرسال بريد إلكتروني إلى <code>diffusers@huggingface.co</code>.</p> <p>لا يتم إصدار نسخة جديدة تلقائياً عند دمج طلب سحب نموذج أو خط أنابيب. قبل الإصدار، يتحقق المسؤولون أولاً من اكتمال التكامل ومن نجاح اختبارات الإصدار.</p> <p>عادةً ما يُدمج دعم النموذج أو خط المعالجة الجديد في الإصدار الفرعي التالي. يتم دمج التكامل في <code>main</code> ويُنشأ فرع الإصدار منه. يحتوي الإصدار على جميع التغييرات المدمجة منذ الإصدار السابق، وليس فقط تكامل النموذج أو خط المعالجة.</p> <p>تُبرز ملاحظات الإصدار النموذج أو خط الأنابيب الجديد، كما تلخص التغييرات الأخرى المضمنة في الإصدار. وتُخصص إصدارات التصحيح عادةً لإصلاحات الإصدار الموجود مسبقًا.</p> <p>تحتوي مكتبة Diffusers على بعض طلبات الميزات المفتوحة لجميع المكونات الثلاثة - لا تتردد في الاطلاع عليها إذا كنت لا تعرف بعد المكون المحدد الذي ترغب في إضافته:</p> <ul><li><a href="https://github.com/huggingface/diffusers/issues?q=is%3Aopen+is%3Aissue+label%3A%22New+pipeline%2Fmodel%22" rel="nofollow">النموذج أو خط الأنابيب</a></li> <li><a href="https://github.com/huggingface/diffusers/issues?q=is%3Aopen+is%3Aissue+label%3A%22New+scheduler%22" rel="nofollow">المجدول</a></li></ul> <p>قبل إضافة أيٍّ من المكونات الثلاثة، يُوصى بشدة بقراءة <a href="philosophy">دليل الفلسفة</a> لفهم أفضل لتصميم أيٍّ من المكونات الثلاثة. يرجى العلم أننا لا نستطيع دمج إضافات النماذج أو المجدول أو خطوط الأنابيب التي تنحرف بشدة عن فلسفتنا التصميمية، لأن ذلك سيؤدي إلى عدم اتساق في واجهة برمجة التطبيقات. إذا كنت لا توافق بشكل أساسي على خيار تصميمي معين، فيرجى فتح <a href="https://github.com/huggingface/diffusers/issues/new?assignees=&amp;labels=&amp;template=feedback.md&amp;title=" rel="nofollow">قضية ملاحظات</a> بدلاً من ذلك حتى يمكن مناقشة ما إذا كان ينبغي تغيير نمط التصميم/الخيار التصميمي المحدد في جميع أنحاء المكتبة، وما إذا كان ينبغي تحديث فلسفتنا التصميمية. الاتساق عبر المكتبة مهم جداً بالنسبة لنا.</p> <p>يرجى التأكد من إضافة روابط إلى قاعدة الأكواد الأصلية/الورقة البحثية في طلب الدمج (PR)، ومن الأفضل أيضًا التواصل مباشرة مع المؤلف الأصلي على طلب الدمج حتى يتمكن من متابعة التقدم والإجابة عن الأسئلة المحتملة.</p> <p>إذا كنت غير متأكد أو عالِقًا في طلب الإرسال، فلا تتردد في ترك رسالة تطلب فيها مراجعة أولى أو مساعدة.</p> <!--[3--><h4 class="relative group"><a id="copied-from-mechanism" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#copied-from-mechanism"><span><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg><!----></span></a> <span><!---->تم النسخ من mechanism<!----></span></h4><!--]--><!----> <p>ميزة فريدة ومهمة يجب فهمها عند إضافة أي كود خط أنابيب أو نموذج أو مجدول هي آلية <code># Copied from</code>. ستجد هذه الآلية في جميع أنحاء قاعدة أكواد Diffusers، والسبب في استخدامها هو إبقاء قاعدة الأكواد سهلة الفهم والصيانة. وضع علامة على الكود بآلية <code># Copied from</code> يجبر الكود المُعلَّم على أن يكون مطابقاً تماماً للكود الذي نُسخ منه. وهذا يسهّل تحديث التغييرات ونشرها عبر العديد من الملفات كلما قمت بتشغيل <code>make fix-copies</code>.</p> <p>على سبيل المثال، في مثال الشيفرة أدناه، <a href="/docs/diffusers/main/ar/api/pipelines/stable_diffusion/img2img#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput">StableDiffusionPipelineOutput</a> هو الشيفرة الأصلية بينما يستخدم <code>AltDiffusionPipelineOutput</code> آلية <code># Copied from</code> لنسخها. الفارق الوحيد هو تغيير بادئة الفئة من <code>Stable</code> إلى <code>Alt</code>.</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg><!----> <div class=" absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0 "><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent;"></div> تم النسخ</div><!----></button><!----></div> <pre class="language-py "><!----><span class="hljs-comment"># Copied from diffusers.pipelines.stable_diffusion.pipeline_output.StableDiffusionPipelineOutput with Stable-&gt;Alt</span>
<span class="hljs-keyword">class</span> <span class="hljs-title class_">AltDiffusionPipelineOutput</span>(<span class="hljs-title class_ inherited__">BaseOutput</span>):
<span class="hljs-string">&quot;&quot;&quot;
Output class for Alt Diffusion pipelines.
Args:
images (`List[PIL.Image.Image]` or `np.ndarray`)
List of denoised PIL images of length `batch_size` or NumPy array of shape `(batch_size, height, width,
num_channels)`.
nsfw_content_detected (`List[bool]`)
List indicating whether the corresponding generated image contains &quot;not-safe-for-work&quot; (nsfw) content or
`None` if safety checking could not be performed.
&quot;&quot;&quot;</span><!----></pre></div><!----> <p>للمزيد من التفاصيل، اقرأ هذا القسم من منشور المدونة <a href="https://huggingface.co/blog/transformers-design-philosophy#4-machine-learning-models-are-static" rel="nofollow">~لا تكرر نفسك*</a>.</p> <!--[1--><h2 class="relative group"><a id="how-to-write-a-good-issue" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#how-to-write-a-good-issue"><span><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg><!----></span></a> <span><!---->كيفية كتابة مشكلة جيدة<!----></span></h2><!--]--><!----> <p><strong>كلما كانت المشكلة التي تكتبها أفضل، زادت احتمالات حلها بسرعة.</strong></p> <ol><li>تأكد من أنك استخدمت القالب الصحيح لمشكلتك. يمكنك الاختيار بين <em>تقرير خطأ</em>، <em>طلب ميزة</em>، <em>ملاحظات حول تصميم واجهة برمجة التطبيقات</em>، <em>إضافة نموذج/خط أنابيب/مجدول جديد</em>، أو مشكلة فارغة. تأكد من اختيار القالب الصحيح عند فتح <a href="https://github.com/huggingface/diffusers/issues/new/choose" rel="nofollow">مشكلة جديدة</a>. أسئلة الاستخدام تنتمي إلى <a href="https://github.com/huggingface/diffusers/discussions" rel="nofollow">GitHub Discussions</a> وليس إلى مشكلة.</li> <li><strong>كن دقيقًا</strong>: امنح مشكلتك عنوانًا مناسبًا. حاول صياغة وصف المشكلة بأبسط شكل ممكن. كلما كنت أكثر دقة عند تقديم المشكلة، قلّ الوقت المطلوب لفهمها وحلّها على الأرجح. تأكد من فتح مشكلة واحدة فقط لكل مشكلة، وليس لمشكلات متعددة. إذا اكتشفت عدة مشكلات، فافتح عدة مشكلات ببساطة. إذا كانت مشكلتك خطأ برمجيًا، فحاول أن تكون دقيقًا قدر الإمكان بشأن طبيعة الخطأ - فلا تكتفِ بكتابة «خطأ في diffusers».</li> <li><strong>إمكانية التكرار</strong>: لا يوجد مقتطف كود قابل للتكرار == لا يوجد حل. إذا واجهت خطأً، يجب على <strong>المسؤولين عن المشروع أن يكونوا قادرين على إعادة إنتاجه</strong>. تأكد من تضمين مقتطف كود يمكن نسخه ولصقه في مُفسّر Python لإعادة إنتاج المشكلة. تأكد من أن مقتطف الكود يعمل، <em>أي</em> أنه لا توجد استيرادات مفقودة أو روابط مفقودة إلى الصور، ... يجب أن يحتوي تقريرك على رسالة خطأ <strong>و</strong> مقتطف كود يمكن نسخه ولصقه دون أي تغييرات لإعادة إنتاج نفس رسالة الخطأ تمامًا. إذا كان تقريرك يستخدم أوزان نموذج محلية أو بيانات محلية لا يمكن للقارئ الوصول إليها، فلا يمكن حل المشكلة. إذا لم تتمكن من مشاركة بياناتك أو نموذجك، فحاول إنشاء نموذج وهمي أو بيانات وهمية.</li> <li><strong>بسيط</strong>: حاول مساعدة القارئ قدر الإمكان على فهم المشكلة بأسرع وقت ممكن من خلال الإيجاز قدر المستطاع. احذف جميع الأكواد / جميع المعلومات غير ذات الصلة بالمسألة. إذا اكتشفت خطأً، فحاول إنشاء مثال كود أسهل ما يمكن لإظهار مشكلتك، ولا تُلصق سير عملك بأكمله في المشكلة بمجرد اكتشافك للخطأ. على سبيل المثال، إذا كنت تدرب نموذجًا واجهت خطأً في نقطة معينة أثناء التدريب، فيجب أن تحاول أولاً فهم الجزء المسؤول عن الخطأ في كود التدريب ومحاولة إعادة إنتاجه بسطرين من الكود. حاول استخدام بيانات وهمية بدلاً من مجموعات البيانات الكاملة.</li> <li><strong>السياق</strong>: أخبرنا بما كنت تعمل عليه عندما واجهت الخلل أو احتجت إلى الميزة، مثل تطبيق مبني على Diffusers، أو مشروع بحثي، أو وكيل (Agent) شغّلته للعثور على أخطاء في المكتبة. جملة أو جملتان تكفيان، ويُرحَّب برابط إلى المشروع. نتلقى عددًا من القضايا وطلبات الدمج يتجاوز قدرتنا على التعامل معها دفعة واحدة، لذا يساعدنا السياق في تحديد الأولويات بناءً على الأثر.</li> <li>أضِف الروابط. إذا كنت تشير إلى تسمية أو طريقة أو نموذج معين، فتأكد من توفير رابط حتى يتمكن القارئ من فهم ما تقصده بشكل أفضل. إذا كنت تشير إلى طلب سحب (PR) أو مشكلة (issue) محددة، فتأكد من ربطها بمشكلتك. لا تفترض أن القارئ يعرف ما تتحدث عنه. كلما أضفت المزيد من الروابط إلى مشكلتك كان ذلك أفضل.</li> <li>تنسيق. تأكد من تنسيق مشكلتك بشكل جيد من خلال تنسيق الأكواد وفق صياغة كود بايثون، ورسائل الخطأ وفق صياغة كود عادي. راجع <a href="https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax" rel="nofollow">وثائق تنسيق GitHub الرسمية</a> لمزيد من المعلومات.</li> <li>فكّر في مشكلتك لا بوصفها تذكرة يجب حلّها، بل بوصفها مدخلًا جميلًا في موسوعة مكتوبة بعناية. كل مشكلة تُضاف هي مساهمة في المعرفة المتاحة للعامة. فبإضافة مشكلة مكتوبة بشكل جيد، لا تسهّل على المُحافظين حلّ مشكلتك فحسب، بل تساعد المجتمع بأكمله على فهم جانب معين من المكتبة بشكل أفضل.</li></ol> <!--[1--><h2 class="relative group"><a id="how-to-write-a-good-pr" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#how-to-write-a-good-pr"><span><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg><!----></span></a> <span><!---->كيفية كتابة طلب دمج جيد<!----></span></h2><!--]--><!----> <ol><li>ابدأ دائمًا من مشكلة. ابحث عن المشكلة التي يعالجها طلب الإرسال الخاص بك، أو افتح واحدة إذا لم يفعل أحد ذلك بعد، ومنح المُحافظين فرصة للرد قبل كتابة أي كود. سير العمل الذي يعمل بشكل أفضل بالنسبة لنا هو فتح مشكلة، ثم مناقشة الحل، ثم طلب إرسال مبني على تلك المناقشة. يتيح لنا ذلك التركيز على المشكلات الأكثر تأثيرًا، والاتفاق على النطاق قبل وجود الكود، وتجنب العمل المكرر. اذكر رقم المشكلة في وصف طلب الإرسال (مثلًا <code>Fixes #1234</code>) حتى يتم ربط الاثنين.</li> <li>كن كالسحلية المتلوّنة. افهم أنماط التصميم والقواعد النحوية الموجودة، وتأكد من أن إضافاتك في الكود تندمج بسلاسة مع قاعدة الكود الحالية. لن يتم دمج طلبات السحب التي تنحرف بشكل كبير عن أنماط التصميم أو واجهات المستخدم الحالية.</li> <li>كن دقيقًا في تركيزك. يجب أن يعالج طلب الدمج مشكلة واحدة فقط. تأكد من عدم الوقوع في فخ «إصلاح مشكلة أخرى أثناء إضافتها». فمن الأصعب بكثير مراجعة طلبات الدمج التي تحل عدة مشاكل غير مترابطة في آنٍ واحد.</li> <li>عالِج الأنماط، لا الحالات الفردية. قد تمتد مشكلة واحدة عبر ملفات كثيرة: إذا تكرر نفس الخطأ في أنحاء قاعدة الشيفرة، فابحث عن كل حالة منها وأصلحها جميعًا في طلب دمج واحد بنطاق واضح ومنهجي (مثلًا: «إصلاح القيم الافتراضية القابلة للتغيير في جميع المجدولين»)، بدلاً من طلب دمج لكل حالة على حدة.</li> <li>يجب أن يكون عنوان طلب السحب الخاص بك ملخصًا لإسهامه. للإشارة إلى أن العمل قيد التنفيذ، ضع بادئة <code>[WIP]</code> قبل العنوان؛ وهذا يمنع تكرار العمل ويفصل طلب السحب عن الطلبات الجاهزة للدمج.</li> <li>حاول صياغة نصك وتنسيقه كما هو موضح في <a href="#how-to-write-a-good-issue">كيف تكتب مشكلة جيدة</a>.</li> <li>راجع الفرق الخاص بك قبل فتح طلب الدمج. اقرأه كما سيفعل المراجع وقوّم ما تجده. ننصح بشدة بتشغيل مهارة <a href="https://github.com/huggingface/diffusers/blob/main/.ai/skills/self-review/SKILL.md" rel="nofollow"><code>self-review</code></a>: فهي تطبّق المعايير نفسها التي يستخدمها مراجع CI الخاص بـ<code>@claude</code>. اضبط وكيلك كما هو موصوف في <a href="#coding-with-ai-agents">البرمجة مع وكلاء الذكاء الاصطناعي</a> واتبع إرشادات <a href="#ai-assisted-and-agentic-contributions">المساهمات بمساعدة الذكاء الاصطناعي والوكلاء</a>. اذكر في الوصف الملاحظات التي تركتها عمدًا كما هي، حتى يدرك المراجع أنها قرار متعمد وليس إغفالًا.</li> <li>تأكد من نجاح الاختبارات الموجودة مسبقًا.</li> <li>أضِف اختبارات ذات تغطية عالية. لا يوجد اختبار جودة = لا يوجد دمج.</li></ol> <ul><li>إذا كنت تضيف اختبارات جديدة <code>@slow</code>، فتأكد من نجاحها باستخدام <code>RUN_SLOW=1 python -m pytest tests/test_my_new_model.py</code>.
لا يشغّل CircleCI الاختبارات البطيئة، لكن GitHub Actions يشغّلها كل ليلة!</li></ul> <ol start="10"><li>يجب أن تحتوي جميع الطرق العامة على سلاسل توثيق (docstrings) مفيدة تعمل بشكل جيد مع تنسيق Markdown. راجع <a href="https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/latent_diffusion/pipeline_latent_diffusion.py" rel="nofollow"><code>pipeline_latent_diffusion.py</code></a> كمثال.</li> <li>نظرًا للنمو السريع للمستودع، من المهم التأكد من عدم إضافة ملفات قد تُثقل المستودع بشكل كبير. ويشمل ذلك الصور والفيديوهات وملفات غير النصية الأخرى. نفضّل الاعتماد على مجموعة بيانات <code>dataset</code> مستضافة على hf.co مثل <a href="https://huggingface.co/hf-internal-testing" rel="nofollow"><code>hf-internal-testing</code></a> أو <a href="https://huggingface.co/datasets/huggingface/documentation-images" rel="nofollow">huggingface/documentation-images</a> لوضع هذه الملفات.
إذا كان المساهمة خارجية، فلا تتردد في إضافة الصور إلى طلب الإرسال الخاص بك واطلب من عضو في Hugging Face نقل صورك إلى هذه المجموعة.</li></ol> <!--[1--><h2 class="relative group"><a id="how-to-open-a-pr" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#how-to-open-a-pr"><span><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg><!----></span></a> <span><!---->كيفية فتح طلب دمج<!----></span></h2><!--]--><!----> <p>قبل كتابة أي كود، ننصحك بشدة بالبحث في طلبات الدمج (PRs) أو المشكلات (issues) الموجودة للتأكد من أن أحداً لا يعمل على نفس الشيء بالفعل. وإذا كنت غير متأكد، فإن فتح مشكلة (issue) للحصول على بعض الملاحظات هو دائماً فكرة جيدة.</p> <p>ستحتاج إلى إتقان أساسي لأداة <code>git</code> حتى تتمكن من المساهمة في
🧨 Diffusers. ليست <code>git</code> الأداة الأسهل في الاستخدام، لكنها تمتلك أفضل
دليل مرجعي. اكتب <code>git --help</code> في سطر الأوامر واستمتع. إذا كنت تفضّل الكتب، فإن <a href="https://git-scm.com/book/en/v2" rel="nofollow">Pro
Git</a> مرجع ممتاز.</p> <p>اتبع هذه الخطوات لبدء المساهمة (<a href="https://github.com/huggingface/diffusers/blob/83bc6c94eaeb6f7704a2a428931cf2d9ad973ae9/setup.py#L270" rel="nofollow">إصدارات Python المدعومة</a>):</p> <ol><li><p>أنشئ نسخةً من <a href="https://github.com/huggingface/diffusers" rel="nofollow">المستودع</a> بالنقر على زر "Fork" في صفحة المستودع. يؤدي هذا إلى إنشاء نسخة من الكود تحت حسابك على GitHub.</p></li> <li><p>استنسخ فرعك إلى القرص المحلي، وأضف المستودع الأساسي كمستودع بعيد:</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg><!----> <div class=" absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0 "><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent;"></div> تم النسخ</div><!----></button><!----></div> <pre class="language-bash "><!---->$ git <span class="hljs-built_in">clone</span> git@github.com:&lt;your GitHub handle&gt;/diffusers.git
$ <span class="hljs-built_in">cd</span> diffusers
$ git remote add upstream https://github.com/huggingface/diffusers.git<!----></pre></div><!----></li> <li><p>أنشئ فرعًا جديدًا لاستيعاب تغييرات التطوير الخاصة بك:</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg><!----> <div class=" absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0 "><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent;"></div> تم النسخ</div><!----></button><!----></div> <pre class="language-bash "><!---->$ git checkout -b a-descriptive-name-for-my-changes<!----></pre></div><!----></li></ol> <p>لا <strong>تعمل</strong> على الفرع <code>main</code>.</p> <ol start="4"><li><p>قم بإعداد بيئة التطوير من خلال تنفيذ الأمر التالي في بيئة افتراضية:</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg><!----> <div class=" absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0 "><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent;"></div> تم النسخ</div><!----></button><!----></div> <pre class="language-bash "><!---->$ pip install -e <span class="hljs-string">&quot;.[dev]&quot;</span><!----></pre></div><!----></li></ol> <p>إذا كنت قد استنسلت المستودع مسبقًا، فقد تحتاج إلى <code>git pull</code> للحصول على أحدث التغييرات في المكتبة.</p> <ol start="5"><li>طوّر الميزات على فرعك.</li></ol> <p>أثناء عملك على الميزات، يجب أن تتأكد من نجاح مجموعة الاختبارات. يجب عليك تشغيل الاختبارات المتأثرة بتغييراتك على النحو التالي:</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg><!----> <div class=" absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0 "><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent;"></div> تم النسخ</div><!----></button><!----></div> <pre class="language-bash "><!---->$ pytest tests/&lt;TEST_TO_RUN&gt;.py<!----></pre></div><!----> <p>قبل تشغيل الاختبارات، يرجى التأكد من تثبيت التبعيات المطلوبة للاختبار. يمكنك القيام بذلك
باستخدام هذا الأمر:</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg><!----> <div class=" absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0 "><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent;"></div> تم النسخ</div><!----></button><!----></div> <pre class="language-bash "><!---->$ pip install -e <span class="hljs-string">&quot;.[test]&quot;</span><!----></pre></div><!----> <p>يمكنك أيضًا تشغيل مجموعة الاختبارات الكاملة باستخدام الأمر التالي، لكن الأمر يتطلب جهازًا قويًا لإنتاج نتيجة في وقت معقول، نظرًا للنمو الكبير الذي شهدته مكتبة Diffusers. إليك الأمر لذلك:</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg><!----> <div class=" absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0 "><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent;"></div> تم النسخ</div><!----></button><!----></div> <pre class="language-bash "><!---->$ make <span class="hljs-built_in">test</span><!----></pre></div><!----> <p>🧨 يعتمد Diffusers على <code>black</code> و<code>isort</code> لتنسيق كود المصدر بشكل متسق. بعد إجراء التغييرات، طبّق تصحيحات الأسلوب التلقائية والتحقق من الكود الذي لا يمكن أتمتته دفعة واحدة باستخدام:</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg><!----> <div class=" absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0 "><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent;"></div> تم النسخ</div><!----></button><!----></div> <pre class="language-bash "><!---->$ make style<!----></pre></div><!----> <p>🧨 Diffusers also uses <code>ruff</code> and a few custom scripts to check for coding mistakes. Quality
control runs in CI, however, you can also run the same checks with:</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg><!----> <div class=" absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0 "><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent;"></div> تم النسخ</div><!----></button><!----></div> <pre class="language-bash "><!---->$ make quality<!----></pre></div><!----> <p>بمجرد أن تكون راضياً عن تعديلاتك، أضف الملفات المعدّلة باستخدام <code>git add</code> وأنشئ التزاماً باستخدام <code>git commit</code> لتسجيل تعديلاتك محلياً:</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg><!----> <div class=" absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0 "><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent;"></div> تم النسخ</div><!----></button><!----></div> <pre class="language-bash "><!---->$ git add modified_file.py
$ git commit -m <span class="hljs-string">&quot;A descriptive message about your changes.&quot;</span><!----></pre></div><!----> <p>من الجيد مزامنة نسختك من الكود مع المستودع الأصلي بانتظام. بهذه الطريقة يمكنك التعامل مع التغييرات بسرعة:</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg><!----> <div class=" absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0 "><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent;"></div> تم النسخ</div><!----></button><!----></div> <pre class="language-bash "><!---->$ git pull upstream main<!----></pre></div><!----> <p>ادفع التغييرات إلى حسابك باستخدام:</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg><!----> <div class=" absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0 "><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent;"></div> تم النسخ</div><!----></button><!----></div> <pre class="language-bash "><!---->$ git push -u origin a-descriptive-name-for-my-changes<!----></pre></div><!----> <ol start="6"><li><p>بمجرد أن تكون راضياً عن النتيجة، انتقل إلى
صفحة فرعك على GitHub. انقر على ‘Pull request’ لإرسال تغييراتك
إلى مُديري المشروع للمراجعة.</p></li> <li><p>لا بأس إذا طلب منك المساهمون إجراء تعديلات. فذلك يحدث للمساهمين الأساسيين أيضًا! ولكي يتمكن الجميع من رؤية التعديلات في طلب الدمج، اعمل في فرعك المحلي ثم ادفع التعديلات إلى نسختك من المستودع. ستظهر تلقائيًا في طلب الدمج.</p></li></ol> <!--[2--><h3 class="relative group"><a id="tests" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#tests"><span><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg><!----></span></a> <span><!---->الاختبارات<!----></span></h3><!--]--><!----> <p>تتضمن المكتبة مجموعة اختبارات شاملة لاختبار سلوك المكتبة وعدة أمثلة. يمكن العثور على اختبارات المكتبة في
<a href="https://github.com/huggingface/diffusers/tree/main/tests" rel="nofollow">مجلد الاختبارات</a>.</p> <p>نفضّل <code>pytest</code> و<code>pytest-xdist</code> لأنها أسرع. من جذر المستودع، إليك كيفية تشغيل الاختبارات باستخدام <code>pytest</code> للمكتبة:</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg><!----> <div class=" absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0 "><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent;"></div> تم النسخ</div><!----></button><!----></div> <pre class="language-bash "><!---->$ python -m pytest -n auto --dist=loadfile -s -v ./tests/<!----></pre></div><!----> <p>في الواقع، هذا هو بالضبط كيف يتم تنفيذ <code>make test</code>!</p> <p>يمكنك تحديد مجموعة أصغر من الاختبارات لاختبار الميزة التي تعمل عليها فقط.</p> <p>بشكل افتراضي، يتم تخطي الاختبارات البطيئة. اضبط متغير البيئة <code>RUN_SLOW</code> على <code>yes</code> لتشغيلها. سيؤدي هذا إلى تنزيل عدة جيجابايت من النماذج — تأكد من
امتلاك مساحة كافية على القرص واتصال جيد بالإنترنت، أو الكثير من الصبر!</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg><!----> <div class=" absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0 "><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent;"></div> تم النسخ</div><!----></button><!----></div> <pre class="language-bash "><!---->$ RUN_SLOW=<span class="hljs-built_in">yes</span> python -m pytest -n auto --dist=loadfile -s -v ./tests/<!----></pre></div><!----> <p><code>unittest</code> مدعوم بالكامل، وإليك كيفية تشغيل الاختبارات باستخدامه:</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg><!----> <div class=" absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0 "><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent;"></div> تم النسخ</div><!----></button><!----></div> <pre class="language-bash "><!---->$ python -m unittest discover -s tests -t . -v
$ python -m unittest discover -s examples -t examples -v<!----></pre></div><!----> <!--[2--><h3 class="relative group"><a id="syncing-forked-main-with-upstream-huggingface-main" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#syncing-forked-main-with-upstream-huggingface-main"><span><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg><!----></span></a> <span><!---->مزامنة الفرع الرئيسي المنفصل مع الفرع الرئيسي في المصدر (HuggingFace)<!----></span></h3><!--]--><!----> <p>لتجنب إرسال إشعارات إلى المستودع الأصلي الذي يضيف ملاحظات مرجعية إلى كل طلب دمج في المستودع الأصلي ويرسل إشعارات غير ضرورية إلى المطورين المشاركين في هذه الطلبات، عند مزامنة الفرع الرئيسي للمستودع المنسوخ، يرجى اتباع الخطوات التالية:</p> <ol><li>عندما يكون ذلك ممكنًا، تجنّب المزامنة مع المستودع الأصلي باستخدام فرع وطلب دمج على المستودع المنسوخ. وبدلاً من ذلك، ادمج مباشرةً في الفرع الرئيسي للمستودع المنسوخ.</li> <li>إذا كان طلب الدمج ضروريًا تمامًا، فاستخدم الخطوات التالية بعد استخلاص فرعك:</li></ol> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg><!----> <div class=" absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0 "><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent;"></div> تم النسخ</div><!----></button><!----></div> <pre class="language-bash "><!---->$ git checkout -b your-branch-for-syncing
$ git pull --squash --no-commit upstream main
$ git commit -m <span class="hljs-string">&#x27;&lt;your message without GitHub references&gt;&#x27;</span>
$ git push --set-upstream origin your-branch-for-syncing<!----></pre></div><!----> <!--[2--><h3 class="relative group"><a id="style-guide" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#style-guide"><span><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg><!----></span></a> <span><!---->دليل الأسلوب<!----></span></h3><!--]--><!----> <p>تتبع مكتبة 🧨 Diffusers أسلوب <a href="https://google.github.io/styleguide/pyguide.html" rel="nofollow">Google</a> في كتابة سلاسل التوثيق.</p> <!--[1--><h2 class="relative group"><a id="coding-with-ai-agents" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#coding-with-ai-agents"><span><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg><!----></span></a> <span><!---->البرمجة باستخدام وكلاء الذكاء الاصطناعي<!----></span></h2><!--]--><!----> <p>يحتفظ المستودع بإعدادات وكيل الذكاء الاصطناعي في <a href="https://github.com/huggingface/diffusers/tree/main/.ai" rel="nofollow"><code>.ai/</code></a>، كما يُنشر كإضافة للوكيل بحيث تُثبَّت مهارات المهام عند الطلب في خطوة واحدة.</p> <ul><li><strong>قراءة فقط للمساهمين</strong> — يُدير <code>.ai/</code> المسؤولون الأساسيون. يرجى عدم تعديل الملفات الموجودة تحت <code>.ai/</code> (أو روابط <code>AGENTS.md</code> / <code>CLAUDE.md</code> على مستوى الجذر، أو المهارات المثبتة في <code>.agents/skills</code> / <code>.claude/skills</code>) في طلب الإرسال الخاص بك. إذا لاحظت نقصًا أو خطأً ما، فافتح مشكلة أو أشر إلى ذلك في طلب الإرسال وسيتولى أحد المسؤولين تحديثه.</li> <li><strong>Guidelines</strong> — <code>.ai/AGENTS.md</code> يتم تحميله في كل جلسة وكيل عبر الروابط الرمزية الجذرية <code>AGENTS.md</code> / <code>CLAUDE.md</code> ؛ وتُقرأ أدلة المرجع الموجودة تحت <code>.ai/references/</code> عند الطلب عند اتباع رابط: <ul><li><a href="https://github.com/huggingface/diffusers/blob/main/.ai/AGENTS.md" rel="nofollow"><code>.ai/AGENTS.md</code></a> — إرشادات الترميز على المستوى الأعلى</li> <li><a href="https://github.com/huggingface/diffusers/blob/main/.ai/references/models.md" rel="nofollow"><code>.ai/references/models.md</code></a> — نمط الانتباه، قواعد تنفيذ النموذج، الاتفاقيات الشائعة</li> <li><a href="https://github.com/huggingface/diffusers/blob/main/.ai/references/pipelines.md" rel="nofollow"><code>.ai/references/pipelines.md</code></a> — اتفاقيات خطوط الأنابيب</li> <li><a href="https://github.com/huggingface/diffusers/blob/main/.ai/references/modular.md" rel="nofollow"><code>.ai/references/modular.md</code></a> — اتفاقيات خطوط الأنابيب المعيارية وقائمة التحقق من التحويل</li> <li><a href="https://github.com/huggingface/diffusers/blob/main/.ai/references/testing.md" rel="nofollow"><code>.ai/references/testing.md</code></a> — طبقات الاختبار المطلوبة، مزيجات المُختبِر، قواعد مكوّنات الوهم</li> <li><a href="https://github.com/huggingface/diffusers/blob/main/.ai/references/review-rules.md" rel="nofollow"><code>.ai/references/review-rules.md</code></a> — ما يبحث عنه المراجعون</li></ul></li> <li><strong>Skills</strong> (تحت <a href="https://github.com/huggingface/diffusers/tree/main/.ai/skills" rel="nofollow"><code>.ai/skills/</code></a>, تُحمَّل عند الطلب للمهام المحددة): <ul><li><code>model-integration</code> — إضافة نموذج أو خط أنابيب جديد إلى diffusers من البداية إلى النهاية (هيكل الملفات، قائمة التحقق من التكامل، تخطيط الاختبارات، تحويل الأوزان)</li> <li><code>self-review</code> — راجع تغييراتك مقابل قواعد المشروع قبل فتح طلب دمج</li> <li><code>diffusers-cli</code> — تشغيل خطوط الأنابيب وفحص المخططات من الطرفية</li> <li><code>custom-blocks</code> — تغليف فئة فرعية من <code>ModularPipelineBlocks</code> للمركز</li></ul></li></ul> <p>بغضّ النظر عن المسار الذي تختاره، اطلب من وكيلك تأكيد إعداداته الخاصة قبل أن تبدأ — <code>python utils/check_ai.py</code> يتحقق من اتساق الأدلة والمهارات، و<code>diffusers-cli skills list</code> يعرض المهارات التي يمتلكها فعليًا.</p> <!--[2--><h3 class="relative group"><a id="ai-assisted-and-agentic-contributions" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#ai-assisted-and-agentic-contributions"><span><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg><!----></span></a> <span><!---->المساهمات بمساعدة الذكاء الاصطناعي والوكيلية<!----></span></h3><!--]--><!----> <p>نرحّب بالوكلاء (Agents) بالذكاء الاصطناعي للمساهمة في Diffusers. نشجعك على إعداد وكيلك باستخدام <a href="https://github.com/huggingface/diffusers/blob/main/.ai/AGENTS.md" rel="nofollow">دليل الوكلاء</a> الخاص بـ Diffusers واستخدام المهارات المحددة ذات الصلة بالمهام، مثل <code>model-integration</code> و<code>self-review</code>. ثبّت الإضافة (أو المهارات الفردية) كما هو موضح أعلاه، ثم اتبع الدليل لتحديد نطاق مساهمتك وتنفيذها واختبارها ومراجعتها. تبقى مسؤولاً عن فهم التغييرات في طلب الإرسال الخاص بك واختبارها وصيانتها.</p> <p>نرحّب بالمساهمات المدعومة بالذكاء الاصطناعي، لكن يجب تنسيقها وتحديد نطاقها والتحقق منها للحفاظ على قابلية إدارة عبء المراجعة. قد تُغلق طلبات الدمج التي لا تلتزم بهذه الإرشادات دون إجراء مراجعة تفصيلية.</p> <ul><li><strong>تنسيق قبل فتح طلب سحب.</strong> ابحث عن مشكلة أو افتح واحدة، راجع طلبات السحب المشابهة (المفتوحة والمغلقة مؤخرًا)، وانتظر تأكيدًا صريحًا من أحد المشرفين على تلك المشكلة قبل فتح طلب سحب. يمنحنا ذلك فرصة لمناقشة النطاق، وتجنب العمل المكرر، والتأكد من المنهجية.</li> <li><strong>عالِج الأنماط، لا الحالات الفردية.</strong> إذا لاحظت مشكلة متكررة، فابحث في قاعدة الشيفرة عن حالات مشابهة وافتح <em>قضية واحدة</em> بنطاق واضح ومنهجي (مثلًا «إصلاح القيم الافتراضية القابلة للتغيير عبر جميع المجدولين») بدلاً من فتح العديد من القضايا أو طلبات الدمج لكل حالة على حدة.</li> <li><strong>المراجعة الذاتية قبل الفتح.</strong> نفّذ مهارة <a href="https://github.com/huggingface/diffusers/blob/main/.ai/skills/self-review/SKILL.md" rel="nofollow"><code>self-review</code></a> — فهي تراجع فرقك (diff) مقابل <a href="https://github.com/huggingface/diffusers/blob/main/.ai/references/review-rules.md" rel="nofollow"><code>.ai/references/review-rules.md</code></a>، وهي المعايير ذاتها التي يستخدمها مراجع CI الخاص بـ <code>@claude</code> — وتعامل مع ما يُبلّغ عنه؛ فهو أداة مساعدة وليست مرجعية حاسمة، وقد يكون مخطئًا. ركّز على المشكلات العالقة التي تبدو منطقية بالنسبة لك، ونظّف الكود الميت أو غير المستخدم قدر الإمكان. إذا كنت لا توافق على اقتراح ما، فلا بأس من تركه ليُناقشه المراجع بعد فتح طلب الدمج (PR) — فالملاحظات التي تشاركها (انظر أدناه) تُخبر المراجع أن ذلك كان قرارًا متعمدًا.</li> <li><strong>شارك ملاحظات المراجعة الذاتية الخاصة بك.</strong> يُرجى نشر تقرير المراجعة الذاتية النهائي — الجولة التي تعكس الفروقات التي تُقدّمها — على طلب الدمج، في الوصف أو كتعليق، مع تضمين النتائج التي اخترت عمدًا عدم إصلاحها والسبب وراء ذلك. يساعد ذلك المُراجِع على رؤية ما تم فحصه مسبقًا وأي قرارات كانت متعمدة، ويوفّر عادةً جولات عدة من التبادل.</li> <li><strong>اجعل تواصلك في طلبات الدمج موجزًا.</strong> كل ما يقرؤه المُراجِع في طلب الدمج الخاص بك — الوصف، رسائل الالتزامات، التعليقات والردود، تعليقات الأكواد — يجب أن يكون سهل الفهم على الإنسان. إذا صاغه وكيلك، فلا تكتفِ بمراجعته سريعًا. اقرأه، واطلب من الوكيل تعديله حتى يصبح نصًا منطقيًا وموجزًا كنتَ ستكتبه بنفسك. أنت مؤلف كل ما تنشره.</li> <li><strong>Include in the PR description:</strong> <ul><li>رابط <strong>تنسيق</strong> إلى المشكلة أو النقاش الذي اعترف فيه أحد المشرفين بالعمل.</li> <li><strong>أوامر الاختبار التي قمت بتشغيلها</strong> ونتائجها (الصق المخرجات ذات الصلة، وليس مجرد «الاختبارات ناجحة»).</li> <li>ملاحظاتك <strong>للمراجعة الذاتية</strong> (أو رابط إلى تعليق طلب الإرسال الذي يحتوي عليها)، كما هو موضح أعلاه.</li></ul></li></ul> <p>إذا كنت مؤلف نموذج أو جزءًا من فريق يقوم رسميًا بصيانة نموذج، فنشجعك على استخدام الوكلاء (agents) لدمج نموذج جديد. اتبع <a href="https://github.com/huggingface/diffusers/blob/main/.ai/AGENTS.md" rel="nofollow">الإعداد الموصى به</a> في المستودع واستخدم مهارة <a href="https://github.com/huggingface/diffusers/blob/main/.ai/skills/model-integration/SKILL.md" rel="nofollow"><code>model-integration</code></a>. تنسيق نطاق العمل مع المشرفين قبل فتح طلب سحب (PR) — راجع <a href="#10-adding-pipelines-models-schedulers">إضافة خطوط الأنابيب والنماذج والمجدولين</a>.</p> <a class="!text-gray-400 !no-underline text-sm flex items-center not-prose mt-4" href="https://github.com/huggingface/diffusers/blob/main/docs/source/en/conceptual/contribution.md" target="_blank"><svg class="mr-1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M31,16l-7,7l-1.41-1.41L28.17,16l-5.58-5.59L24,9l7,7z"></path><path d="M1,16l7-7l1.41,1.41L3.83,16l5.58,5.59L8,23l-7-7z"></path><path d="M12.419,25.484L17.639,6.552l1.932,0.518L14.351,26.002z"></path></svg><!----> <span><span class="underline">Update</span> on GitHub</span></a><!----> <p></p><!--]--><!----><!--]--><!--]--><!--]--> <!--[-1--><!--]--><!--]-->
<script>
{
__sveltekit_g37pnb = {
base: "/docs/diffusers/main/en",
assets: "/docs/diffusers/main/en"
};
const element = document.currentScript.parentElement;
Promise.all([
import("/docs/diffusers/main/en/_app/immutable/entry/start.D3LnKZ4R.js"),
import("/docs/diffusers/main/en/_app/immutable/entry/app.C0rBoMxR.js")
]).then(([kit, app]) => {
kit.start(app, element, {
node_ids: [0, 304],
data: [null,null],
form: null,
error: null
});
});
}
</script>

Xet Storage Details

Size:
141 kB
·
Xet hash:
8c8ff63e780a5593c950bedb8e0fad5f0b89f6466ce5c992ffd9fbc8dd22f99a

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.