OpceanAI commited on
Commit
12c3560
·
verified ·
1 Parent(s): 74ca8a2

Upload Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +38 -0
Dockerfile ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.10-slim
2
+
3
+ WORKDIR /app
4
+
5
+ RUN apt-get update && apt-get install -y \
6
+ git \
7
+ curl \
8
+ && rm -rf /var/lib/apt/lists/*
9
+
10
+ COPY requirements.txt .
11
+ RUN pip install --no-cache-dir -r requirements.txt
12
+
13
+ COPY app.py .
14
+
15
+ # Descargar modelos al construir la imagen
16
+ RUN python -c "\
17
+ from transformers import AutoTokenizer, AutoModelForCausalLM; \
18
+ \
19
+ print('Downloading Yuuki NxG tokenizer...'); \
20
+ AutoTokenizer.from_pretrained('OpceanAI/Yuuki-NxG'); \
21
+ print('Downloading Yuuki NxG model...'); \
22
+ AutoModelForCausalLM.from_pretrained('OpceanAI/Yuuki-NxG'); \
23
+ print('Yuuki NxG ready!'); \
24
+ \
25
+ print('Downloading Yuuki Nano tokenizer...'); \
26
+ AutoTokenizer.from_pretrained('OpceanAI/Yuuki-Nano'); \
27
+ print('Downloading Yuuki Nano model...'); \
28
+ AutoModelForCausalLM.from_pretrained('OpceanAI/Yuuki-Nano'); \
29
+ print('Yuuki Nano ready!'); \
30
+ \
31
+ print('All models downloaded!')"
32
+
33
+ EXPOSE 7860
34
+
35
+ HEALTHCHECK --interval=30s --timeout=10s --start-period=120s --retries=3 \
36
+ CMD curl -f http://localhost:7860/health || exit 1
37
+
38
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]