Huggingface.js documentation
الواجهة: CommitEditFileParams
@huggingface/inference
استخدام عميل الاستدلالمرجع الواجهة البرمجية
الفئات
HfInferenceInferenceClientInferenceClientEndpointInferenceClientErrorInferenceClientHubApiErrorInferenceClientInputErrorInferenceClientProviderApiErrorInferenceClientProviderOutputErrorInferenceClientRoutingError
الواجهات
AudioToAudioOutputAudioToAudioOutputElemBaseArgsBodyParamsHeaderParamsInferenceProviderMappingEntryLoggerخياراتTextGenerationInputTextGenerationOutputTextGenerationStreamBestOfSequenceTextGenerationStreamDetailsTextGenerationStreamOutputTextGenerationStreamPrefillTokenTextGenerationStreamTokenUrlParams
وحدات
@huggingface/hub
التفاعل مع Hubمرجع الواجهة البرمجية
الفئات
الواجهات
AuthInfoCachedFileInfoCachedRepoInfoCachedRevisionInfoCommitCopyFileCommitDataCommitDeletedEntryCommitEditFileCommitEditFileParamsCommitFileCommitInfoCommitOutputCopyDestinationCopyFilesEntryCopyProgressEventCopySourceبيانات الاعتمادDatasetEntryFileDownloadInfoOutputHFCacheInfoJobVolumeLfsPathInfoListFileEntryMlxQuantizationConfigModelConfigModelDerivedFieldsModelEntryOAuthResultParallelDownloadOptionsPathInfoQuantizationConfigRangeEditCacheEntryRepoIdSafetensorsIndexJsonSafetensorsShardFileInfoSecurityFileStatusSpaceEntrySpaceResourceConfigSpaceResourceRequirementSpaceRuntimeTensorInfoUserInfoWhoAmIAppWhoAmIOrgWhoAmIUserXetFileInfoXetReadToken
@huggingface/mcp-client
@huggingface/tiny-agents
@huggingface/space-header
@huggingface/gguf
@huggingface/lerobot
@huggingface/usd-web-viewer
الواجهة: CommitEditFileParams
تعديل ملف موجود عن طريق استبدال نطاقات البايتات من محتواه الأصلي، دون إعادة رفع الملف بأكمله.
عندما يأتي originalContent من downloadFile على ملف مدعوم بتقنية xet، فإن الأجزاء غير المعدلة لا يتم تنزيلها ولا إعادة رفعها: بل يتم نقل نطاقات البايتات المعدلة فقط (والأجزاء المحيطة بحدود المقاطع الخاصة بها). ويعمل هذا بالكامل عن بُعد — دون تنزيل البيانات غير المعدلة على الإطلاق — عند الرفع إلى حاوية.
Example
const original = await downloadFile({ repo: "buckets/me/repo", path: "model.gguf" });
await uploadFile({
repo: "buckets/me/repo",
file: {
path: "model.gguf",
originalContent: original,
edits: [{ start: 0, end: 100, content: new Blob([patchedHeader]) }],
},
});الخصائص
تعديلات
• تعديلات: { content: Blob ; end: number ; start: number }[]
معرّف في
packages/hub/src/lib/upload-file.ts:29
originalContent
• originalContent: Blob
المحتوى الحالي للملف، كما يُعاد مثلاً بواسطة downloadFile
معرّف في
packages/hub/src/lib/upload-file.ts:28
path
• path: string
معرّف في
packages/hub/src/lib/upload-file.ts:26
Update on GitHub