yalsaffar commited on
Commit
8e69b04
·
1 Parent(s): 376224b

Updated Dockerfile for Hugging Face Spaces deployment

Browse files
Files changed (2) hide show
  1. Dockerfile +3 -3
  2. models/nllb.py +1 -1
Dockerfile CHANGED
@@ -47,8 +47,8 @@ ENV LD_LIBRARY_PATH=${CUDA_HOME}/lib64:${LD_LIBRARY_PATH}
47
  # Set environment variable for NeMo cache directory
48
  ENV NEMO_NLP_TMP=/app/.cache
49
 
50
- # Create cache directories with appropriate permissions
51
- RUN mkdir -p /app/.cache/huggingface && chmod -R 777 /app/.cache
52
 
53
  # Copy the setup script and requirements file into the container
54
  COPY setup.sh requirements.txt /app/
@@ -97,4 +97,4 @@ EXPOSE 3000
97
  ENV IN_DOCKER=True
98
 
99
  # Run the FastAPI app and Node.js server
100
- CMD ["sh", "-c", "uvicorn app:app --host 0.0.0.0 --port 8000 & /app/wait-for-it.sh --timeout=300 --strict http://0.0.0.0:8000/health -- node /app/app/server.js"]
 
47
  # Set environment variable for NeMo cache directory
48
  ENV NEMO_NLP_TMP=/app/.cache
49
 
50
+ # Create cache directory
51
+ RUN mkdir -p /app/.cache && chmod -R 777 /app/.cache
52
 
53
  # Copy the setup script and requirements file into the container
54
  COPY setup.sh requirements.txt /app/
 
97
  ENV IN_DOCKER=True
98
 
99
  # Run the FastAPI app and Node.js server
100
+ CMD ["sh", "-c", "uvicorn app:app --host 0.0.0.0 --port 8000 & /app/wait-for-it.sh --url http://0.0.0.0:8000/health --strict -- node /app/app/server.js"]
models/nllb.py CHANGED
@@ -17,7 +17,7 @@ def nllb():
17
  model, tokenizer = nllb()
18
  """
19
  #device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
20
- device = torch.device("cpu")
21
  # Load the tokenizer and model
22
  os.environ['HF_HOME'] = '/app/.cache/huggingface'
23
  os.environ['TRANSFORMERS_CACHE'] = '/app/.cache/huggingface'
 
17
  model, tokenizer = nllb()
18
  """
19
  #device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
20
+ device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
21
  # Load the tokenizer and model
22
  os.environ['HF_HOME'] = '/app/.cache/huggingface'
23
  os.environ['TRANSFORMERS_CACHE'] = '/app/.cache/huggingface'