liumaolin
commited on
Commit
·
fd3c30a
1
Parent(s):
23c146f
Adjust context window allocation logic based on memory tiers in `apple_silicon.py`
Browse files
src/voice_dialogue/utils/apple_silicon.py
CHANGED
|
@@ -216,11 +216,11 @@ def get_optimal_llama_cpp_config() -> Dict[str, int]:
|
|
| 216 |
|
| 217 |
# 根据内存大小调整上下文窗口
|
| 218 |
if chip_info.memory_gb >= 32:
|
| 219 |
-
n_ctx = 8192
|
| 220 |
-
elif chip_info.memory_gb >= 16:
|
| 221 |
n_ctx = 4096
|
| 222 |
-
|
| 223 |
n_ctx = 2048
|
|
|
|
|
|
|
| 224 |
|
| 225 |
return {
|
| 226 |
'n_threads': n_threads,
|
|
|
|
| 216 |
|
| 217 |
# 根据内存大小调整上下文窗口
|
| 218 |
if chip_info.memory_gb >= 32:
|
|
|
|
|
|
|
| 219 |
n_ctx = 4096
|
| 220 |
+
elif chip_info.memory_gb >= 16:
|
| 221 |
n_ctx = 2048
|
| 222 |
+
else:
|
| 223 |
+
n_ctx = 1024
|
| 224 |
|
| 225 |
return {
|
| 226 |
'n_threads': n_threads,
|