Sidoineko commited on
Commit
71786b7
·
1 Parent(s): cf8e6a2

Fix Dockerfile and README: update MODEL_ID to google/gemma-3n-E4B-it and optimize environment variables

Browse files
Files changed (2) hide show
  1. Dockerfile +6 -7
  2. README.md +12 -10
Dockerfile CHANGED
@@ -35,15 +35,14 @@ COPY . /app/
35
  # Créer les dossiers cache et donner les droits d'écriture
36
  RUN mkdir -p /app/cache/huggingface /tmp/hf_cache /tmp/model_offload && \
37
  chmod -R 777 /app/cache/huggingface /tmp/hf_cache /tmp/model_offload
38
- ENV HF_HOME=/app/cache/huggingface
39
-
40
- # Variables d'environnement optimisées pour Hugging Face Spaces
41
- ENV PORT=7860
42
- ENV HOST=0.0.0.0
43
- ENV MODEL_ID=google/gemma-3n-e2b-it
44
  ENV DEVICE_MAP=cpu
45
  ENV MAX_NEW_TOKENS=256
46
- ENV PYTHONPATH=/app/src
47
 
48
  # Health check
49
  HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \
 
35
  # Créer les dossiers cache et donner les droits d'écriture
36
  RUN mkdir -p /app/cache/huggingface /tmp/hf_cache /tmp/model_offload && \
37
  chmod -R 777 /app/cache/huggingface /tmp/hf_cache /tmp/model_offload
38
+ # Set environment variables
39
+ ENV PYTHONPATH=/app
40
+ ENV HF_HOME=/tmp/hf_home
41
+ ENV TRANSFORMERS_CACHE=/tmp/hf_home/transformers
42
+ ENV HF_HUB_ENABLE_HF_TRANSFER=0
43
+ ENV MODEL_ID=google/gemma-3n-E4B-it
44
  ENV DEVICE_MAP=cpu
45
  ENV MAX_NEW_TOKENS=256
 
46
 
47
  # Health check
48
  HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \
README.md CHANGED
@@ -54,16 +54,18 @@ curl -X POST \
54
  https://huggingface.co/spaces/sido1991/apiagrilens/diagnose
55
  ```
56
 
57
- ## Model Information
58
 
59
- - **Model**: google/gemma-3n-e2b-it
60
- - **Type**: Image-to-Text
61
- - **Purpose**: Plant disease diagnosis
62
- - **Language**: French responses
63
 
64
- ## Environment Variables
 
 
 
65
 
66
- - `MODEL_ID`: Model identifier (default: google/gemma-3n-e2b-it)
67
- - `DEVICE_MAP`: Device mapping (default: auto)
68
- - `MAX_NEW_TOKENS`: Maximum tokens for generation (default: 256)
69
- - `HF_TOKEN`: Hugging Face token for model access
 
 
 
54
  https://huggingface.co/spaces/sido1991/apiagrilens/diagnose
55
  ```
56
 
57
+ ## Configuration
58
 
59
+ ### Variables d'environnement
 
 
 
60
 
61
+ - **Model**: google/gemma-3n-E4B-it
62
+ - **Device**: CPU (optimisé pour Hugging Face Spaces)
63
+ - **Max Tokens**: 256
64
+ - **Cache Directory**: /tmp/hf_home
65
 
66
+ ### Variables configurables
67
+
68
+ - `MODEL_ID`: Model identifier (default: google/gemma-3n-E4B-it)
69
+ - `DEVICE_MAP`: Device mapping (default: cpu)
70
+ - `MAX_NEW_TOKENS`: Maximum new tokens for generation (default: 256)
71
+ - `HF_HOME`: Hugging Face cache directory (default: /tmp/hf_home)