alethanhson commited on
Commit
9a2c58a
·
1 Parent(s): 9475ff0

fix message

Browse files
Files changed (1) hide show
  1. app.py +0 -5
app.py CHANGED
@@ -12,18 +12,15 @@ from pydantic import BaseModel
12
 
13
  from generator import load_csm_1b, Segment
14
 
15
- # Thiết lập logging
16
  logging.basicConfig(level=logging.INFO)
17
  logger = logging.getLogger(__name__)
18
 
19
- # Khởi tạo FastAPI app
20
  app = FastAPI(
21
  title="CSM 1B API",
22
  description="API for Sesame's Conversational Speech Model",
23
  version="1.0.0",
24
  )
25
 
26
- # Thêm CORS middleware
27
  app.add_middleware(
28
  CORSMiddleware,
29
  allow_origins=["*"],
@@ -32,10 +29,8 @@ app.add_middleware(
32
  allow_headers=["*"],
33
  )
34
 
35
- # Biến toàn cục để lưu trữ mô hình
36
  generator = None
37
 
38
- # Định nghĩa các models để validate request
39
  class SegmentRequest(BaseModel):
40
  speaker: int
41
  text: str
 
12
 
13
  from generator import load_csm_1b, Segment
14
 
 
15
  logging.basicConfig(level=logging.INFO)
16
  logger = logging.getLogger(__name__)
17
 
 
18
  app = FastAPI(
19
  title="CSM 1B API",
20
  description="API for Sesame's Conversational Speech Model",
21
  version="1.0.0",
22
  )
23
 
 
24
  app.add_middleware(
25
  CORSMiddleware,
26
  allow_origins=["*"],
 
29
  allow_headers=["*"],
30
  )
31
 
 
32
  generator = None
33
 
 
34
  class SegmentRequest(BaseModel):
35
  speaker: int
36
  text: str