[Bugfix] Migrate CreateAudio from deprecated class Config to ConfigDict (#5245)
Signed-off-by: Nick Cao <ncao@redhat.com> Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
1 parent
5f95115e70
commit
0677064b87
1 file changed
+3
-4
@@ -5,7 +5,7 @@ from dataclasses import dataclass
|
|||||||
from typing import Annotated, Any, Literal
|
from typing import Annotated, Any, Literal
|
||||||
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
from pydantic import AliasChoices, BaseModel, Field, PrivateAttr, field_validator, model_validator
|
from pydantic import AliasChoices, BaseModel, ConfigDict, Field, PrivateAttr, field_validator, model_validator
|
||||||
|
|
||||||
# Bound int request fields to avoid overflow issues.
|
# Bound int request fields to avoid overflow issues.
|
||||||
_INT64_MIN = -(2**63)
|
_INT64_MIN = -(2**63)
|
||||||
@@ -423,6 +423,8 @@ class OpenAICreateAudioGenerateRequest(BaseModel):
|
|||||||
|
|
||||||
|
|
||||||
class CreateAudio(BaseModel):
|
class CreateAudio(BaseModel):
|
||||||
|
model_config = ConfigDict(arbitrary_types_allowed=True)
|
||||||
|
|
||||||
audio_tensor: np.ndarray
|
audio_tensor: np.ndarray
|
||||||
sample_rate: int = 24000
|
sample_rate: int = 24000
|
||||||
output_sample_rate: int | None = None
|
output_sample_rate: int | None = None
|
||||||
@@ -430,9 +432,6 @@ class CreateAudio(BaseModel):
|
|||||||
speed: float = 1.0
|
speed: float = 1.0
|
||||||
base64_encode: bool = True
|
base64_encode: bool = True
|
||||||
|
|
||||||
class Config:
|
|
||||||
arbitrary_types_allowed = True
|
|
||||||
|
|
||||||
|
|
||||||
class AudioChunkMetadata(BaseModel):
|
class AudioChunkMetadata(BaseModel):
|
||||||
"""Waveform dimensions after transforms, before encoding.
|
"""Waveform dimensions after transforms, before encoding.
|
||||||
|
|||||||
Reference in new issue
Block a user