yatin-superintelligence commited on
Commit
3eb3e17
·
verified ·
1 Parent(s): 9b9b52d

Upload Dockerfile with huggingface_hub

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -22
Dockerfile CHANGED
@@ -1,26 +1,12 @@
1
- FROM ghcr.io/huggingface/text-generation-inference:latest
2
 
3
- # Secrets injected at runtime via HF Space settings:
4
- # HF_TOKEN — HF token with google/gemma-4-E2B-it access
5
- # VLLM_API_KEY — Bearer token clients must send
 
 
 
6
 
7
  EXPOSE 7860
8
 
9
- # TGI reads HUGGING_FACE_HUB_TOKEN for model download auth.
10
- # API_KEY is TGI's native env var for request authentication.
11
- # --trust-remote-code ensures Gemma 4 chat template + architecture loads correctly.
12
- # --max-input-length / --max-total-tokens set 128k context window.
13
- # --max-concurrent-requests 8 — serves up to 8 simultaneous episodes.
14
- ENTRYPOINT []
15
- CMD ["sh", "-c", "\
16
- HUGGING_FACE_HUB_TOKEN=$HF_TOKEN \
17
- API_KEY=$VLLM_API_KEY \
18
- text-generation-launcher \
19
- --model-id google/gemma-4-E2B-it \
20
- --port 7860 \
21
- --dtype bfloat16 \
22
- --max-input-length 126000 \
23
- --max-total-tokens 131072 \
24
- --max-concurrent-requests 8 \
25
- --trust-remote-code \
26
- "]
 
1
+ FROM vllm/vllm-openai:latest
2
 
3
+ # Gemma 4 (model_type=gemma4) needs newer transformers than vLLM bundles.
4
+ # TGI does NOT support gemma4 yet — this image uses vLLM which does.
5
+ RUN pip install --no-cache-dir "transformers>=4.51.0" "accelerate>=0.34.0"
6
+
7
+ COPY entrypoint.sh /entrypoint.sh
8
+ RUN chmod +x /entrypoint.sh
9
 
10
  EXPOSE 7860
11
 
12
+ ENTRYPOINT ["/entrypoint.sh"]