ramedde commited on
Commit
4d8fe3a
·
verified ·
1 Parent(s): fa1a7c5

Update entrypoint.sh

Browse files
Files changed (1) hide show
  1. entrypoint.sh +7 -39
entrypoint.sh CHANGED
@@ -11,47 +11,15 @@ REASONING_MODE="${REASONING_MODE:-auto}"
11
  CACHE_TYPE_K="${CACHE_TYPE_K:-f16}"
12
  CACHE_TYPE_V="${CACHE_TYPE_V:-f16}"
13
  FLASH_ATTN="${FLASH_ATTN:-off}"
14
- SPEC_TYPE="${SPEC_TYPE:-ngram-cache}"
15
 
16
  # NOTE: the b8840 CPU build does not support draft-mtp (needs a newer
17
- # llama.cpp build than this image ships). ngram-cache is a self-speculation
18
- # mode that needs no external draft model: it speculates from n-grams already
19
- # seen in context/output, verified by the target model, so it's zero-cost on
20
- # accuracy. Set SPEC_TYPE=none in Space secrets to disable entirely.
21
- SPEC_FLAGS="--spec-type $SPEC_TYPE"
22
-
23
- exec /app/llama-server \
24
- -hf "$MODEL_SPEC" \
25
- --host "$HOST" \
26
- --port "$PORT" \
27
- --ctx-size "$CTX_SIZE" \
28
- --threads "$THREADS" \
29
- --threads-batch "$THREADS" \
30
- --parallel "$PARALLEL" \
31
- --cache-type-k "$CACHE_TYPE_K" \
32
- --cache-type-v "$CACHE_TYPE_V" \
33
- --reasoning "$REASONING_MODE" \
34
- -fa "$FLASH_ATTN" \
35
- $SPEC_FLAGS#!/bin/sh
36
- set -eu
37
-
38
- MODEL_SPEC="${MODEL_SPEC:-owao/Nanbeige4.2-3B-GGUF:Q4_K_M}"
39
- HOST="${HOST:-0.0.0.0}"
40
- PORT="${PORT:-7860}"
41
- CTX_SIZE="${CTX_SIZE:-8192}"
42
- THREADS="${THREADS:-2}"
43
- PARALLEL="${PARALLEL:-1}"
44
- REASONING_MODE="${REASONING_MODE:-auto}"
45
- CACHE_TYPE_K="${CACHE_TYPE_K:-f16}"
46
- CACHE_TYPE_V="${CACHE_TYPE_V:-f16}"
47
- FLASH_ATTN="${FLASH_ATTN:-off}"
48
- SPEC_TYPE="${SPEC_TYPE:-ngram-cache}"
49
-
50
- # NOTE: the b8840 CPU build does not support draft-mtp (needs a newer
51
- # llama.cpp build than this image ships). ngram-cache is a self-speculation
52
- # mode that needs no external draft model: it speculates from n-grams already
53
- # seen in context/output, verified by the target model, so it's zero-cost on
54
- # accuracy. Set SPEC_TYPE=none in Space secrets to disable entirely.
55
  SPEC_FLAGS="--spec-type $SPEC_TYPE"
56
 
57
  exec /app/llama-server \
 
11
  CACHE_TYPE_K="${CACHE_TYPE_K:-f16}"
12
  CACHE_TYPE_V="${CACHE_TYPE_V:-f16}"
13
  FLASH_ATTN="${FLASH_ATTN:-off}"
14
+ SPEC_TYPE="${SPEC_TYPE:-none}"
15
 
16
  # NOTE: the b8840 CPU build does not support draft-mtp (needs a newer
17
+ # llama.cpp build than this image ships). Defaulting to "none" for a
18
+ # guaranteed clean startup. If you want to experiment, ngram-cache is a
19
+ # self-speculation mode needing no external draft model (speculates from
20
+ # n-grams already seen in context/output, verified by the target model, so
21
+ # it's zero-cost on accuracy) — set SPEC_TYPE=ngram-cache as a Space secret
22
+ # to try it.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
  SPEC_FLAGS="--spec-type $SPEC_TYPE"
24
 
25
  exec /app/llama-server \