ndc8 commited on
Commit
255b6fc
·
1 Parent(s): 84eb396
Files changed (1) hide show
  1. backend_service.py +3 -2
backend_service.py CHANGED
@@ -3,10 +3,11 @@ FastAPI Backend AI Service converted from Gradio app
3
  Provides OpenAI-compatible chat completion endpoints
4
  """
5
 
6
- # Direct Hugging Face caches to a writable folder under /tmp
7
  import os
 
8
  os.environ.setdefault("HF_HOME", "/tmp/.cache/huggingface")
9
- os.environ.setdefault("TRANSFORMERS_CACHE", "/tmp/.cache/huggingface")
 
10
  # Define Hugging Face auth token from environment
11
  hf_token = os.environ.get("HF_TOKEN")
12
  import asyncio
 
3
  Provides OpenAI-compatible chat completion endpoints
4
  """
5
 
 
6
  import os
7
+ # Direct Hugging Face caches to a writable folder under /tmp (use only HF_HOME, TRANSFORMERS_CACHE is deprecated)
8
  os.environ.setdefault("HF_HOME", "/tmp/.cache/huggingface")
9
+ # Suppress advisory warnings from transformers (including deprecation warnings)
10
+ os.environ["TRANSFORMERS_NO_ADVISORY_WARNINGS"] = "1"
11
  # Define Hugging Face auth token from environment
12
  hf_token = os.environ.get("HF_TOKEN")
13
  import asyncio