Peter Michael Gits Claude commited on
Commit
d4effe0
·
1 Parent(s): 6558d32

Aggressive Docker enforcement - prevent HuggingFace Rust moshi-server override

Browse files

v2.0.2 - FORCE DOCKER MODE: HF keeps running Rust moshi-server despite config
1. Added .hf_config.json with explicit Docker enforcement
2. Added custom_headers to .space_config.yaml
3. Created .dockerignore to hide files that trigger HF auto-detection
4. Added disable_auto_inference and force_docker flags
5. Prevents: 'Starting Python frontend and official moshi-server' error

Multiple approaches to force our Python Docker container!

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

Files changed (4) hide show
  1. .dockerignore +17 -0
  2. .hf_config.json +7 -0
  3. .space_config.yaml +2 -0
  4. app.py +1 -1
.dockerignore ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Ignore files that might trigger HuggingFace auto-detection
2
+ *.toml
3
+ config.json
4
+ model.safetensors
5
+ pytorch_model.bin
6
+ *.pth
7
+ .git
8
+ .gitattributes
9
+ README*.md
10
+ *_moshi*.py
11
+ *_gradio*.py
12
+ *_minimal*.py
13
+ create_*.py
14
+ deploy_*.py
15
+ fix_*.py
16
+ migrate_*.py
17
+ LinkedInPost*.md
.hf_config.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "sdk": "docker",
3
+ "app_port": 7860,
4
+ "hardware": "l4",
5
+ "disable_auto_inference": true,
6
+ "force_docker": true
7
+ }
.space_config.yaml CHANGED
@@ -8,3 +8,5 @@ hardware: l4
8
  sleep_time_timeout: 1800
9
  suggested_storage: standard
10
  disable_embedding: true
 
 
 
8
  sleep_time_timeout: 1800
9
  suggested_storage: standard
10
  disable_embedding: true
11
+ custom_headers:
12
+ x-space-config: docker-only
app.py CHANGED
@@ -21,7 +21,7 @@ from fastapi.responses import JSONResponse, HTMLResponse
21
  import uvicorn
22
 
23
  # Version tracking
24
- VERSION = "2.0.1"
25
  COMMIT_SHA = "TBD"
26
 
27
  # Configure logging
 
21
  import uvicorn
22
 
23
  # Version tracking
24
+ VERSION = "2.0.2"
25
  COMMIT_SHA = "TBD"
26
 
27
  # Configure logging