OV cache location change
This commit is contained in:
parent
91124a9b4b
commit
6b2f5555a4
@ -212,7 +212,7 @@ def create_minimal_bot_tracks(session_name: str, config: Optional[Dict[str, Any]
|
||||
- sample_rate: audio sample rate (default 48000)
|
||||
- frequency: tone frequency in Hz (default 440)
|
||||
- volume: audio volume 0-1 (default 0.5)
|
||||
- static_color: RGB tuple for static mode (default gray)
|
||||
- static_color: RGB color tuple or string (default (128, 128, 128))
|
||||
|
||||
Returns:
|
||||
Dictionary containing 'video' and 'audio' tracks
|
||||
@ -235,6 +235,16 @@ def create_minimal_bot_tracks(session_name: str, config: Optional[Dict[str, Any]
|
||||
}
|
||||
default_config.update(config) # type: ignore
|
||||
|
||||
# Parse static_color if it's a string
|
||||
if isinstance(default_config.get('static_color'), str): # type: ignore
|
||||
try:
|
||||
color_str = default_config['static_color'] # type: ignore
|
||||
r, g, b = map(int, color_str.split(',')) # type: ignore
|
||||
default_config['static_color'] = (r, g, b)
|
||||
except (ValueError, TypeError):
|
||||
logger.warning(f"Invalid static_color format: {default_config.get('static_color')}, using default") # type: ignore
|
||||
default_config['static_color'] = (128, 128, 128)
|
||||
|
||||
media_clock = MediaClock()
|
||||
|
||||
video_track = ConfigurableVideoTrack(media_clock, default_config) # type: ignore
|
||||
|
@ -156,7 +156,7 @@ class OpenVINOConfig(BaseModel):
|
||||
|
||||
device: str = Field(default=_device, description="Target device for inference")
|
||||
cache_dir: str = Field(
|
||||
default="./ov_cache", description="Cache directory for compiled models"
|
||||
default="/root/.cache", description="Cache directory for compiled models"
|
||||
)
|
||||
enable_quantization: bool = Field(
|
||||
default=True, description="Enable INT8 quantization"
|
||||
@ -510,8 +510,10 @@ class OpenVINOWhisperModel:
|
||||
self.model_id = model_id
|
||||
self.config = config
|
||||
self.device = device
|
||||
self.model_path = Path(model_id.replace("/", "_"))
|
||||
self.quantized_model_path = Path(f"{self.model_path}_quantized")
|
||||
# Ensure cache directory exists
|
||||
Path(self.config.cache_dir).mkdir(parents=True, exist_ok=True)
|
||||
self.model_path = Path(self.config.cache_dir) / model_id.replace("/", "_")
|
||||
self.quantized_model_path = self.model_path / "quantized"
|
||||
|
||||
self.processor: Optional[WhisperProcessor] = None
|
||||
self.ov_model: Optional[OVModelForSpeechSeq2Seq] = None
|
||||
|
Loading…
x
Reference in New Issue
Block a user