BladeSzaSza Claude commited on
Commit
1283e10
·
1 Parent(s): be049b1

Fix Kyutai model identifier and storage paths for HuggingFace Spaces

Browse files

- Update Kyutai model from kyutai/stt-2.6b-en_fr-trfs to kyutai/stt-2.6b-en-trfs
- Replace /data paths with /tmp temporary storage for HF Spaces compatibility
- Use tempfile module to create writable session directories
- Fixes model loading errors and permission denied issues

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>

Files changed (1) hide show
  1. config.py +12 -5
config.py CHANGED
@@ -23,7 +23,7 @@ class DatabaseConfig:
23
  class AIModelConfig:
24
  """AI model configuration settings"""
25
  qwen_model: str = "Qwen/Qwen3-0.6B"
26
- kyutai_model: str = "kyutai/stt-2.6b-en_fr-trfs"
27
  flux_model: str = "black-forest-labs/FLUX.1-dev"
28
  device: str = "auto"
29
  torch_dtype: str = "auto"
@@ -119,15 +119,22 @@ class DigiPalConfig:
119
 
120
  def _load_production_config(self):
121
  """Production environment configuration"""
122
- # Use /data for HuggingFace Spaces persistent storage
123
- self.database.path = "/data/digipal.db"
124
- self.database.backup_dir = "/data/backups"
 
 
 
 
 
 
 
125
 
126
  self.gradio.debug = False
127
  self.gradio.share = False
128
 
129
  self.logging.level = "INFO"
130
- self.logging.file_path = "/data/logs/digipal.log"
131
 
132
  self.security.session_timeout_hours = 12
133
  self.security.rate_limit_per_minute = 30
 
23
  class AIModelConfig:
24
  """AI model configuration settings"""
25
  qwen_model: str = "Qwen/Qwen3-0.6B"
26
+ kyutai_model: str = "kyutai/stt-2.6b-en-trfs"
27
  flux_model: str = "black-forest-labs/FLUX.1-dev"
28
  device: str = "auto"
29
  torch_dtype: str = "auto"
 
119
 
120
  def _load_production_config(self):
121
  """Production environment configuration"""
122
+ # Use /tmp for HuggingFace Spaces (writable temporary storage)
123
+ import tempfile
124
+ import os
125
+
126
+ # Create temp directory for this session
127
+ temp_dir = os.path.join(tempfile.gettempdir(), "digipal_session")
128
+ os.makedirs(temp_dir, exist_ok=True)
129
+
130
+ self.database.path = os.path.join(temp_dir, "digipal.db")
131
+ self.database.backup_dir = os.path.join(temp_dir, "backups")
132
 
133
  self.gradio.debug = False
134
  self.gradio.share = False
135
 
136
  self.logging.level = "INFO"
137
+ self.logging.file_path = os.path.join(temp_dir, "digipal.log")
138
 
139
  self.security.session_timeout_hours = 12
140
  self.security.rate_limit_per_minute = 30