Skip to content

Commit f2bae29

Browse files
committed
fix: 调整macOS系统显存计算基准并格式化模型哈希表
修正macOS系统显存计算基准,从总内存减去2GB以避免内存不足问题 统一格式化模型哈希表的键值对齐以提高可读性
1 parent 5db0c33 commit f2bae29

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

ai/downloadModels.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ $memoryInfo = Get-SystemMemoryInfo
124124
# macOS系统特殊处理:使用系统内存作为显存计算基准
125125
if ($osType -eq "macOS") {
126126
Write-Host "检测到macOS系统,使用系统内存作为显存计算基准" -ForegroundColor Yellow
127-
$gpuInfo.VramGB = $memoryInfo.TotalGB
127+
$gpuInfo.VramGB = $memoryInfo.TotalGB - 2
128128
$gpuInfo.HasGpu = $true # 将macOS视为有GPU(使用统一内存架构)
129129
}
130130
else {
@@ -164,10 +164,10 @@ foreach ($model in $modelList) {
164164

165165
# 转换为hashtable格式以兼容现有函数
166166
$modelHashtable = @{
167-
Name = $model.name
168-
Size = $model.size
167+
Name = $model.name
168+
Size = $model.size
169169
VramRequired = $model.vramRequired
170-
ModelId = $model.modelId
170+
ModelId = $model.modelId
171171
}
172172

173173
if (Test-ModelCanDownload -Model $modelHashtable -GpuInfo $gpuInfo -MemoryInfo $memoryInfo) {

0 commit comments

Comments
 (0)