matsuap commited on
Commit
2cd01de
·
verified ·
1 Parent(s): 297867c

Upload 2 files

Browse files
Files changed (2) hide show
  1. Dockerfile +3 -0
  2. whisper_fastapi_online_server.py +2 -0
Dockerfile CHANGED
@@ -4,6 +4,9 @@ FROM python:3.11-slim
4
  # 作業ディレクトリを設定
5
  WORKDIR /app
6
 
 
 
 
7
  # 必要なパッケージをインストール
8
  COPY requirements.txt .
9
  RUN pip install --no-cache-dir -r requirements.txt
 
4
  # 作業ディレクトリを設定
5
  WORKDIR /app
6
 
7
+ # .cacheディレクトリを作成
8
+ RUN mkdir -p /.cache && chmod 777 /.cache
9
+
10
  # 必要なパッケージをインストール
11
  COPY requirements.txt .
12
  RUN pip install --no-cache-dir -r requirements.txt
whisper_fastapi_online_server.py CHANGED
@@ -17,6 +17,8 @@ import logging
17
  import logging.config
18
  from transformers import pipeline
19
 
 
 
20
  MODEL_NAME = 'Helsinki-NLP/opus-tatoeba-en-ja'
21
  TRANSLATOR = pipeline('translation', model=MODEL_NAME, device='cuda')
22
  TRANSLATOR('Warming up!')
 
17
  import logging.config
18
  from transformers import pipeline
19
 
20
+ os.environ['HF_HOME'] = './.cache'
21
+
22
  MODEL_NAME = 'Helsinki-NLP/opus-tatoeba-en-ja'
23
  TRANSLATOR = pipeline('translation', model=MODEL_NAME, device='cuda')
24
  TRANSLATOR('Warming up!')