Spaces:
Sleeping
Sleeping
deployed model
Browse files- .gitignore +5 -1
- Dockerfile +11 -7
- app.py +4 -0
.gitignore
CHANGED
@@ -1,3 +1,7 @@
|
|
1 |
.DS_Store
|
2 |
backend/.DS_Store
|
3 |
-
backend/models/bert-mood-prediction-1.pt
|
|
|
|
|
|
|
|
|
|
1 |
.DS_Store
|
2 |
backend/.DS_Store
|
3 |
+
backend/models/bert-mood-prediction-1.pt
|
4 |
+
config.json
|
5 |
+
backend/models/.locks
|
6 |
+
backend/models/models--dhruthick--my-bert-lyrics-classifier
|
7 |
+
hf_cache
|
Dockerfile
CHANGED
@@ -1,15 +1,19 @@
|
|
1 |
-
FROM python
|
2 |
|
|
|
|
|
|
|
3 |
WORKDIR /app
|
4 |
|
5 |
-
|
6 |
-
|
7 |
|
8 |
-
|
9 |
-
RUN pip install --upgrade pip
|
10 |
-
RUN pip install -r requirements.txt
|
11 |
|
12 |
-
|
|
|
|
|
|
|
13 |
|
14 |
EXPOSE 7860
|
15 |
|
|
|
1 |
+
FROM python:3.9
|
2 |
|
3 |
+
# The two following lines are requirements for the Dev Mode to be functional
|
4 |
+
# Learn more about the Dev Mode at https://huggingface.co/dev-mode-explorers
|
5 |
+
RUN useradd -m -u 1000 user
|
6 |
WORKDIR /app
|
7 |
|
8 |
+
COPY --chown=user ./requirements.txt requirements.txt
|
9 |
+
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
10 |
|
11 |
+
COPY --chown=user . /app
|
|
|
|
|
12 |
|
13 |
+
USER user
|
14 |
+
|
15 |
+
ENV HOME=/home/user \
|
16 |
+
PATH=/home/user/.local/bin:$PATH
|
17 |
|
18 |
EXPOSE 7860
|
19 |
|
app.py
CHANGED
@@ -3,8 +3,12 @@ from lyricsgenius import Genius
|
|
3 |
import json
|
4 |
import torch
|
5 |
import numpy as np
|
|
|
6 |
from transformers import BertTokenizer, BertForSequenceClassification, AutoTokenizer, AutoModelForSequenceClassification
|
7 |
|
|
|
|
|
|
|
8 |
app = Flask(__name__)
|
9 |
|
10 |
mood_map = {
|
|
|
3 |
import json
|
4 |
import torch
|
5 |
import numpy as np
|
6 |
+
import os
|
7 |
from transformers import BertTokenizer, BertForSequenceClassification, AutoTokenizer, AutoModelForSequenceClassification
|
8 |
|
9 |
+
# Set the TRANSFORMERS_CACHE environment variable
|
10 |
+
os.environ['TRANSFORMERS_CACHE'] = './hf_cache'
|
11 |
+
|
12 |
app = Flask(__name__)
|
13 |
|
14 |
mood_map = {
|