Skip to content

When the model is downloading, the progressInfo in the progress_callback method sometimes lacks the status, name, and file attributes #1401

@kukudixiaoming

Description

@kukudixiaoming

System Info

npm:
"@huggingface/transformers": "^3.7.2",
"onnxruntime-node": "^1.22.0-rev",
"electron": "^28.0.0",
OS: Windows 11 home edition
model: Mozilla/distilvit

Environment/Platform

  • Website/web-app
  • Browser extension
  • Server-side (e.g., Node.js, Deno, Bun)
  • Desktop app (e.g., Electron)
  • Other (e.g., VSCode extension)

Description

When the model is downloading, the progressInfo in the progress_callback method sometimes lacks the status, name, and file attributes. I found that the loss occurs in the progress status, without name and file fields, making it impossible for me to determine which specific file's download progress it is.

Image

Reproduction

this.model = await VisionEncoderDecoderModel.from_pretrained(modelConfig.id, modelOptions);

progress_callback:

const createProgressCallback = (componentType: 'processor' | 'model') => {
      return (progress: any) => {
        const logMessage = `[${new Date().toLocaleString('zh-CN', { timeZone: 'Asia/Shanghai' })}] createProgressCallback 进度: ${componentType} ${JSON.stringify(progress)}\n`;
        console.log('createProgressCallback 进度:', componentType, progress);
        try {
          appendFileSync(join(this.cacheDir, 'progress.log'), logMessage, 'utf8');
        } catch (error) {
          console.error('写入日志文件失败:', error);
        }
        }
      };
    };

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions