wd21 commited on
Commit
c07613b
·
verified ·
1 Parent(s): 5619732

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +3 -2
Dockerfile CHANGED
@@ -80,7 +80,7 @@ SYNC_EOF
80
 
81
  RUN chmod +x /usr/local/bin/sync.py
82
 
83
- # 启动脚本 start-openclaw(修正 Hugging Face 的 api 为 openai-completions)
84
  RUN cat > /usr/local/bin/start-openclaw << 'EOF'
85
  #!/bin/bash
86
  set -e
@@ -122,11 +122,12 @@ elif [ -n "$OPENAI_API_KEY" ]; then
122
  fi
123
 
124
  if [ -n "$HF_API_TOKEN" ] && [ -n "$HF_MODEL" ]; then
 
125
  PROVIDERS_JSON=$(echo "$PROVIDERS_JSON" | jq \
126
  --arg baseUrl "https://api-inference.huggingface.co" \
127
  --arg apiKey "$HF_API_TOKEN" \
128
  --arg model "$HF_MODEL" \
129
- '.huggingface = {"baseUrl": $baseUrl, "apiKey": $apiKey, "api": "openai-completions", "models": [{"id": $model, "name": $model, "contextWindow": 4096}]}')
130
  fi
131
 
132
  DEFAULT_PROVIDER=""
 
80
 
81
  RUN chmod +x /usr/local/bin/sync.py
82
 
83
+ # 启动脚本 start-openclaw(Hugging Face 模型强制 contextWindow=16000)
84
  RUN cat > /usr/local/bin/start-openclaw << 'EOF'
85
  #!/bin/bash
86
  set -e
 
122
  fi
123
 
124
  if [ -n "$HF_API_TOKEN" ] && [ -n "$HF_MODEL" ]; then
125
+ # 强制设置 contextWindow 为 16000 以满足 OpenClaw 要求
126
  PROVIDERS_JSON=$(echo "$PROVIDERS_JSON" | jq \
127
  --arg baseUrl "https://api-inference.huggingface.co" \
128
  --arg apiKey "$HF_API_TOKEN" \
129
  --arg model "$HF_MODEL" \
130
+ '.huggingface = {"baseUrl": $baseUrl, "apiKey": $apiKey, "api": "openai-completions", "models": [{"id": $model, "name": $model, "contextWindow": 16000}]}')
131
  fi
132
 
133
  DEFAULT_PROVIDER=""