Skip to content

Commit ea35e3c

Browse files
committed
Make "import llama_cpp" import replacements more robust
1 parent 75be46d commit ea35e3c

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

.github/workflows/build-wheels-oobabooga.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ jobs:
188188
$content = Get-Content $_ -raw
189189
$content = $content -replace '(?m)^import llama_cpp\.', 'from . import '
190190
$content = $content -replace '(?m)^from llama_cpp\.', 'from .'
191-
$content = $content -replace '(?m)^\s*import llama_cpp\s*$', 'import llama_cpp_cuda as llama_cpp'
191+
$content = $content -replace '(?m)^(\s*)import llama_cpp(\s*)$', '${1}import llama_cpp_cuda as llama_cpp${2}'
192192
$content | Set-Content $_ -NoNewline
193193
})
194194
}

.github/workflows/build-wheels-rocm-full.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ jobs:
180180
$content = Get-Content $_ -raw
181181
$content = $content -replace '(?m)^import llama_cpp\.', 'from . import '
182182
$content = $content -replace '(?m)^from llama_cpp\.', 'from .'
183-
$content = $content -replace '(?m)^\s*import llama_cpp\s*$', 'import llama_cpp_cuda as llama_cpp'
183+
$content = $content -replace '(?m)^(\s*)import llama_cpp(\s*)$', '${1}import llama_cpp_cuda as llama_cpp${2}'
184184
$content | Set-Content $_ -NoNewline
185185
})
186186
}

.github/workflows/build-wheels-tensorcores.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ jobs:
188188
$content = Get-Content $_ -raw
189189
$content = $content -replace '(?m)^import llama_cpp\.', 'from . import '
190190
$content = $content -replace '(?m)^from llama_cpp\.', 'from .'
191-
$content = $content -replace '(?m)^\s*import llama_cpp\s*$', 'import llama_cpp_cuda_tensorcores as llama_cpp'
191+
$content = $content -replace '(?m)^(\s*)import llama_cpp(\s*)$', '${1}import llama_cpp_cuda_tensorcores as llama_cpp${2}'
192192
$content | Set-Content $_ -NoNewline
193193
})
194194
}

0 commit comments

Comments
 (0)