fraunhofer commited on
Commit
b58a541
·
1 Parent(s): 7604960

dockerfile fasterwhisper için değiştirildi

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -8
Dockerfile CHANGED
@@ -1,13 +1,11 @@
1
- # Python 3.9 tabanlı bir Linux kuruyoruz
2
  FROM python:3.9
3
 
4
- # Çalışma klasörünü ayarla
5
  WORKDIR /code
6
 
7
- # Ses işleme için gerekli olan FFmpeg'i kur (Linux paket yöneticisiyle)
8
  RUN apt-get update && apt-get install -y ffmpeg
9
 
10
- # Kütüphane listesini kopyala ve kur
11
  COPY ./requirements.txt /code/requirements.txt
12
  RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
13
 
@@ -17,12 +15,13 @@ USER user
17
  ENV HOME=/home/user \
18
  PATH=/home/user/.local/bin:$PATH
19
 
20
- # Kodları sunucuya kopyala
21
  WORKDIR $HOME/app
22
  COPY --chown=user . $HOME/app
23
 
24
- # Modeli önceden indir (Deploy süresini hızlandırır)
25
- RUN python3 -c "import whisper; whisper.load_model('base')"
 
 
26
 
27
- # Uygulamayı başlat (Port 7860 olmak ZORUNDA)
28
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
1
  FROM python:3.9
2
 
 
3
  WORKDIR /code
4
 
5
+ # FFmpeg kurulumu (Ses işleme için şart)
6
  RUN apt-get update && apt-get install -y ffmpeg
7
 
8
+ # Kütüphaneleri yükle
9
  COPY ./requirements.txt /code/requirements.txt
10
  RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
11
 
 
15
  ENV HOME=/home/user \
16
  PATH=/home/user/.local/bin:$PATH
17
 
 
18
  WORKDIR $HOME/app
19
  COPY --chown=user . $HOME/app
20
 
21
+ # --- DÜZELTİLEN KISIM BURASI ---
22
+ # Eski 'import whisper' yerine 'faster_whisper' kullanıyoruz.
23
+ # Modeli önbelleğe indiriyoruz ki her açılışta tekrar indirmesin.
24
+ RUN python3 -c "from faster_whisper import WhisperModel; WhisperModel('large-v2', device='cpu', compute_type='int8')"
25
 
26
+ # Uygulamayı başlat
27
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]