Arghet6 commited on
Commit
e2a36e4
·
verified ·
1 Parent(s): 2029b95

Upload 3 files

Browse files
Files changed (2) hide show
  1. Dockerfile +11 -1
  2. app.py +7 -1
Dockerfile CHANGED
@@ -1,5 +1,15 @@
1
  FROM python:3.9
 
 
 
 
2
  WORKDIR /app
3
  COPY . .
4
- RUN pip install -r requirements.txt
 
 
 
 
 
 
5
  CMD ["gunicorn", "--bind", "0.0.0.0:8080", "app:app"]
 
1
  FROM python:3.9
2
+
3
+ # Установка ffmpeg и системных зависимостей
4
+ RUN apt-get update && apt-get install -y ffmpeg && rm -rf /var/lib/apt/lists/*
5
+
6
  WORKDIR /app
7
  COPY . .
8
+
9
+ # Установка Python-зависимостей
10
+ RUN pip install --no-cache-dir -r requirements.txt
11
+
12
+ # Явно скачиваем модель при сборке
13
+ RUN python -c "from transformers import pipeline; pipeline('text-classification', model='cointegrated/rubert-tiny2-cedr-emotion-detection')"
14
+
15
  CMD ["gunicorn", "--bind", "0.0.0.0:8080", "app:app"]
app.py CHANGED
@@ -23,7 +23,13 @@ emotion_map = {
23
  os.environ["PATH"] = r"C:\ffmpeg\bin;" + os.environ["PATH"]
24
 
25
  # Модель для текста
26
- text_classifier = pipeline("text-classification", model="cointegrated/rubert-tiny2-cedr-emotion-detection", top_k=None)
 
 
 
 
 
 
27
 
28
  # Модель для аудио
29
  # Аудио модель: универсальная, с поддержкой русского
 
23
  os.environ["PATH"] = r"C:\ffmpeg\bin;" + os.environ["PATH"]
24
 
25
  # Модель для текста
26
+ text_classifier = pipeline(
27
+ "text-classification",
28
+ model="cointegrated/rubert-tiny2-cedr-emotion-detection",
29
+ config="cointegrated/rubert-tiny2-cedr-emotion-detection",
30
+ tokenizer="cointegrated/rubert-tiny2-cedr-emotion-detection",
31
+ framework="pt" # Явно указываем PyTorch
32
+ )
33
 
34
  # Модель для аудио
35
  # Аудио модель: универсальная, с поддержкой русского