Zoro-chi commited on
Commit
40a0639
·
1 Parent(s): 4e32dd5

Set model environment variables directly in app.py for Hugging Face Spaces

Browse files
Files changed (1) hide show
  1. app.py +7 -0
app.py CHANGED
@@ -26,6 +26,13 @@ os.environ["HTTPX_VERIFY"] = "0"
26
  os.environ["UI_PORT"] = "7860" # Standard Spaces port
27
  os.environ["HF_SPACES"] = "1" # Flag to indicate we're running in Spaces
28
 
 
 
 
 
 
 
 
29
  # Import UI module directly
30
  try:
31
  # Import main function directly from the UI module using direct path import
 
26
  os.environ["UI_PORT"] = "7860" # Standard Spaces port
27
  os.environ["HF_SPACES"] = "1" # Flag to indicate we're running in Spaces
28
 
29
+ # Set model environment variables explicitly for Hugging Face Spaces
30
+ # These will override any variables loaded from .env.spaces
31
+ os.environ["MODEL_ID"] = "distilgpt2" # Use a smaller, well-supported model
32
+ os.environ["USE_LOCAL_MODEL"] = "true"
33
+ os.environ["MODEL_TYPE"] = "transformers"
34
+ os.environ["MODEL_QUANTIZED"] = "true"
35
+
36
  # Import UI module directly
37
  try:
38
  # Import main function directly from the UI module using direct path import