(repoId: string, filename: string)
| 744 | } |
| 745 | |
| 746 | function deriveModelName(repoId: string, filename: string): string { |
| 747 | const baseName = repoId.split('/').pop() || repoId; |
| 748 | const quantization = filename.match(/Q\d+_K_[MSL]|Q\d+_\d+|Q\d+|F\d+/i)?.[0] || ''; |
| 749 | return `${baseName}-${quantization}`.toLowerCase().replace(/[^a-z0-9-]/g, '-'); |
| 750 | } |
| 751 | |
| 752 | function formatFileSizeGb(size: number): string { |
| 753 | return `${(size / 1_073_741_824).toFixed(1)} GB`; |