Use generated short id for llm asr tts
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import os
|
||||
import time
|
||||
import uuid
|
||||
from typing import List, Optional
|
||||
|
||||
import httpx
|
||||
@@ -8,6 +7,7 @@ from fastapi import APIRouter, Depends, File, Form, HTTPException, UploadFile
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
from ..db import get_db
|
||||
from ..id_generator import unique_short_id
|
||||
from ..models import ASRModel
|
||||
from ..schemas import (
|
||||
ASRModelCreate, ASRModelUpdate, ASRModelOut,
|
||||
@@ -72,7 +72,7 @@ def get_asr_model(id: str, db: Session = Depends(get_db)):
|
||||
def create_asr_model(data: ASRModelCreate, db: Session = Depends(get_db)):
|
||||
"""创建ASR模型"""
|
||||
asr_model = ASRModel(
|
||||
id=data.id or str(uuid.uuid4())[:8],
|
||||
id=unique_short_id("asr", db, ASRModel),
|
||||
user_id=1, # 默认用户
|
||||
name=data.name,
|
||||
vendor=data.vendor,
|
||||
|
||||
Reference in New Issue
Block a user