SivaRohith69 commited on
Commit
57e6212
·
1 Parent(s): 87ee24d

Fix Uvicorn crash: Keep Transformers offline but Hub online

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -2
Dockerfile CHANGED
@@ -32,9 +32,13 @@ EXPOSE 7860 8000
32
  # Set environment to use Hugging Face
33
  ENV LLM_PROVIDER=huggingface
34
 
35
- # Explicitly disable offline mode so API calls to Hugging Face Inference stay open
36
- ENV TRANSFORMERS_OFFLINE=0
 
 
 
37
  ENV HF_HUB_OFFLINE=0
 
38
  # Enable Supabase for persistent storage
39
  ENV USE_SUPABASE=true
40
 
@@ -42,6 +46,10 @@ ENV USE_SUPABASE=true
42
  RUN echo '#!/bin/bash\n\
43
  set -e\n\
44
  \n\
 
 
 
 
45
  echo "===== Application Startup at $(date) =====" \n\
46
  echo "=== FocusFlow Startup ===" \n\
47
  \n\
 
32
  # Set environment to use Hugging Face
33
  ENV LLM_PROVIDER=huggingface
34
 
35
+ # Fix: TRANSFORMERS_OFFLINE MUST be 1 otherwise the embedder tries to write to the cache dir (which is owned by root)
36
+ # and throws a PermissionError, crashing Uvicorn at startup.
37
+ ENV TRANSFORMERS_OFFLINE=1
38
+
39
+ # Fix: HF_HUB_OFFLINE MUST be 0 otherwise the Inference APIs (for generating lessons) are blocked from making network requests.
40
  ENV HF_HUB_OFFLINE=0
41
+
42
  # Enable Supabase for persistent storage
43
  ENV USE_SUPABASE=true
44
 
 
46
  RUN echo '#!/bin/bash\n\
47
  set -e\n\
48
  \n\
49
+ # OVERRIDE ANY SPACE SETTINGS TO ENSURE INFERENCE API WORKS\n\
50
+ export HF_HUB_OFFLINE=0\n\
51
+ export TRANSFORMERS_OFFLINE=1\n\
52
+ \n\
53
  echo "===== Application Startup at $(date) =====" \n\
54
  echo "=== FocusFlow Startup ===" \n\
55
  \n\