LahiruD95 commited on
Commit
f4aa29b
·
1 Parent(s): 8a80e2d

Chnaged requirement text

Browse files
Files changed (2) hide show
  1. Dockerfile +2 -1
  2. app/routes.py +5 -1
Dockerfile CHANGED
@@ -37,7 +37,8 @@ ENV PORT=7860
37
  # put near the other ENV lines
38
  ENV XDG_CACHE_HOME=/data/.cache \
39
  TRANSFORMERS_CACHE=/data/.cache/huggingface \
40
- HF_HOME=/data/.cache/huggingface
 
41
 
42
  EXPOSE ${PORT}
43
 
 
37
  # put near the other ENV lines
38
  ENV XDG_CACHE_HOME=/data/.cache \
39
  TRANSFORMERS_CACHE=/data/.cache/huggingface \
40
+ HF_HOME=/data/.cache/huggingface \
41
+ EASYOCR_MODEL_STORAGE=/data/.EasyOCR
42
 
43
  EXPOSE ${PORT}
44
 
app/routes.py CHANGED
@@ -11,8 +11,12 @@ from app.utils import generate_tags, error_response
11
  # Initialize Flask Blueprint
12
  bp = Blueprint('main', __name__)
13
 
 
 
14
  # Initialize the EasyOCR reader for English only (disable GPU if not available)
15
- reader = easyocr.Reader(['en'], gpu=False)
 
 
16
 
17
  EMOTION_SCORE_THRESHOLD = 0.15 # Adjust based on your testing
18
  MIN_SENTIMENT_CONFIDENCE = 0.4 # Below this becomes "neutral"
 
11
  # Initialize Flask Blueprint
12
  bp = Blueprint('main', __name__)
13
 
14
+ model_dir = os.getenv('EASYOCR_MODEL_STORAGE', None)
15
+
16
  # Initialize the EasyOCR reader for English only (disable GPU if not available)
17
+ reader = easyocr.Reader(['en'], gpu=False
18
+ ,model_storage_directory=model_dir
19
+ )
20
 
21
  EMOTION_SCORE_THRESHOLD = 0.15 # Adjust based on your testing
22
  MIN_SENTIMENT_CONFIDENCE = 0.4 # Below this becomes "neutral"