jdalfonso commited on
Commit
e6e87d3
·
1 Parent(s): da29f64

:rocket: deploy for HF

Browse files
Files changed (6) hide show
  1. .gitignore +3 -2
  2. Dockerfile +8 -3
  3. README.md +12 -9
  4. config.py +1 -1
  5. fr-speech-emotion-model.pth +0 -0
  6. requirements.txt +0 -1
.gitignore CHANGED
@@ -179,10 +179,11 @@ dataset/
179
  old/
180
  *.wav
181
  data/*
182
- *.pth
183
  old/
184
  # Mac
185
  .DS_Store
186
  .idea
187
  wav2vec2_emotion/
188
- dataset/
 
 
179
  old/
180
  *.wav
181
  data/*
182
+ # *.pth
183
  old/
184
  # Mac
185
  .DS_Store
186
  .idea
187
  wav2vec2_emotion/
188
+ dataset/
189
+ *.csv
Dockerfile CHANGED
@@ -1,10 +1,8 @@
1
  # Use the official Python image from the Docker Hub
2
- FROM python:3.11-slim
3
 
4
  # Create a new user with a specific UID and switch to it
5
  RUN useradd -m -u 1000 user
6
- USER user
7
-
8
  # Set the PATH environment variable
9
  ENV PATH="/home/user/.local/bin:$PATH"
10
 
@@ -14,6 +12,13 @@ WORKDIR /app
14
  # Copy the requirements.txt file into the container with the correct ownership
15
  COPY --chown=user ./requirements.txt requirements.txt
16
 
 
 
 
 
 
 
 
17
  # Install the dependencies
18
  RUN pip install --no-cache-dir --upgrade -r requirements.txt
19
 
 
1
  # Use the official Python image from the Docker Hub
2
+ FROM python:3.12-slim
3
 
4
  # Create a new user with a specific UID and switch to it
5
  RUN useradd -m -u 1000 user
 
 
6
  # Set the PATH environment variable
7
  ENV PATH="/home/user/.local/bin:$PATH"
8
 
 
12
  # Copy the requirements.txt file into the container with the correct ownership
13
  COPY --chown=user ./requirements.txt requirements.txt
14
 
15
+ # Switch to root user to install necessary build tools and dependencies
16
+ USER root
17
+ RUN apt-get update && apt-get install -y gcc portaudio19-dev && rm -rf /var/lib/apt/lists/*
18
+
19
+ # Switch back to the user
20
+ USER user
21
+
22
  # Install the dependencies
23
  RUN pip install --no-cache-dir --upgrade -r requirements.txt
24
 
README.md CHANGED
@@ -26,6 +26,7 @@ Ce projet est un tableau de bord basé sur Streamlit pour analyser les journaux
26
 
27
  ## Installation
28
 
 
29
  Pour exécuter ce projet localement, suivez ces étapes :
30
 
31
  1. Clonez le dépôt :
@@ -44,15 +45,17 @@ Pour exécuter ce projet localement, suivez ces étapes :
44
  ```sh
45
  pip install -r requirements.txt
46
  ```
47
- 4. Construisez l'image Docker :
48
- ```sh
49
- docker build -t sise-ultimate-challenge .
50
- ```
51
-
52
- 5. Exécutez le conteneur Docker :
53
- ```sh
54
- docker run -p 8501:8501 sise-ultimate-challenge
55
- ```
 
 
56
  ## Utilisation
57
 
58
  Pour démarrer l'application Streamlit, exécutez la commande suivante :
 
26
 
27
  ## Installation
28
 
29
+ ### Locale
30
  Pour exécuter ce projet localement, suivez ces étapes :
31
 
32
  1. Clonez le dépôt :
 
45
  ```sh
46
  pip install -r requirements.txt
47
  ```
48
+
49
+ ### Docker
50
+ 1. Construisez l'image Docker :
51
+ ```sh
52
+ docker build -t sise-ultimate-challenge .
53
+ ```
54
+
55
+ 2. Exécutez le conteneur Docker :
56
+ ```sh
57
+ docker run -p 8501:8501 sise-ultimate-challenge
58
+ ```
59
  ## Utilisation
60
 
61
  Pour démarrer l'application Streamlit, exécutez la commande suivante :
config.py CHANGED
@@ -21,5 +21,5 @@ DEVICE = "cuda" if torch.cuda.is_available() else "cpu"
21
  MODEL_NAME = "facebook/wav2vec2-large-xlsr-53-french"
22
 
23
  BASE_DIR = os.path.dirname(os.path.abspath(__file__))
24
- BEST_MODEL_NAME = os.path.join(BASE_DIR, "model","fr-speech-emotion-model.pth") # Monte d'un niveau pour aller à la racine
25
 
 
21
  MODEL_NAME = "facebook/wav2vec2-large-xlsr-53-french"
22
 
23
  BASE_DIR = os.path.dirname(os.path.abspath(__file__))
24
+ BEST_MODEL_NAME = os.path.join(BASE_DIR,"fr-speech-emotion-model.pth") # Monte d'un niveau pour aller à la racine
25
 
fr-speech-emotion-model.pth ADDED
Binary file (705 kB). View file
 
requirements.txt CHANGED
@@ -15,5 +15,4 @@ scikit-learn
15
  huggingface
16
  huggingface_hub
17
  pyaudio
18
- streamlit_audiorec
19
  dotenv
 
15
  huggingface
16
  huggingface_hub
17
  pyaudio
 
18
  dotenv