Gokul commited on
Commit
029ab19
·
1 Parent(s): 4b2ad11

Migrate to Groq Llama 3 70B

Browse files
Files changed (2) hide show
  1. Dockerfile +6 -24
  2. requirements.txt +0 -0
Dockerfile CHANGED
@@ -1,5 +1,5 @@
1
- # 1. Use Full Python 3.10 (Fixes missing libraries for AI Engine)
2
- FROM python:3.10
3
 
4
  # 2. Set working directory
5
  WORKDIR /app
@@ -9,30 +9,12 @@ RUN useradd -m -u 1000 user
9
  USER user
10
  ENV PATH="/home/user/.local/bin:$PATH"
11
 
12
- # 4. Copy requirements
13
  COPY --chown=user requirements.txt .
 
14
 
15
- # 5. ⚡ ROBUST INSTALLATION STRATEGY ⚡
16
-
17
- # Step A: Update Pip & Wheel (High timeout to prevent network flakes)
18
- RUN pip install --no-cache-dir --upgrade pip setuptools wheel --default-timeout=100
19
-
20
- # Step B: Install Torch CPU-ONLY (Smaller download = No timeout crash)
21
- # We force the CPU version explicitly to avoid downloading the massive GPU version
22
- RUN pip install --no-cache-dir torch --index-url https://download.pytorch.org/whl/cpu --default-timeout=100
23
-
24
- # Step C: Install AI Engine Binary (Force Pre-built Wheel)
25
- # Since we are using full python:3.10, this binary WILL work and installs in seconds.
26
- RUN pip install --no-cache-dir llama-cpp-python \
27
- --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu \
28
- --default-timeout=100
29
-
30
- # Step D: Install remaining requirements
31
- # IMPORTANT: Make sure 'torch' and 'llama-cpp-python' are REMOVED from your requirements.txt
32
- RUN pip install --no-cache-dir -r requirements.txt --default-timeout=100
33
-
34
- # 6. Copy App Code
35
  COPY --chown=user . .
36
 
37
- # 7. Start Server
38
  CMD ["uvicorn", "api.index:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
+ # 1. Use extremely lightweight Python
2
+ FROM python:3.9-slim
3
 
4
  # 2. Set working directory
5
  WORKDIR /app
 
9
  USER user
10
  ENV PATH="/home/user/.local/bin:$PATH"
11
 
12
+ # 4. Copy requirements & Install
13
  COPY --chown=user requirements.txt .
14
+ RUN pip install --no-cache-dir -r requirements.txt
15
 
16
+ # 5. Copy App Code
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
  COPY --chown=user . .
18
 
19
+ # 6. Start Server
20
  CMD ["uvicorn", "api.index:app", "--host", "0.0.0.0", "--port", "7860"]
requirements.txt CHANGED
Binary files a/requirements.txt and b/requirements.txt differ