Jofthomas HF staff commited on
Commit
98ce09e
1 Parent(s): 26fbd68

Update TextGen/router.py

Browse files
Files changed (1) hide show
  1. TextGen/router.py +5 -3
TextGen/router.py CHANGED
@@ -45,7 +45,9 @@ class CreateNewMusic(BaseModel):
45
  ..., description="tags to describe the new music"
46
  )
47
 
48
-
 
 
49
 
50
  class Message(BaseModel):
51
  npc: str | None = None
@@ -212,9 +214,9 @@ def generate_voice_coqui(message: VoiceMessage = None):
212
 
213
  return StreamingResponse(audio_stream(),media_type="audio/mpeg")
214
  @app.get("/generate_song")
215
- async def generate_song(text: str):
216
  song_lyrics=generate_lyrics({
217
- "prompt": f"{text}",
218
  })
219
  data = custom_generate_audio({
220
  "prompt": song_lyrics['text'],
 
45
  ..., description="tags to describe the new music"
46
  )
47
 
48
+ class SongRequest(BaseModel):
49
+ prompt: str | None = None
50
+ tags: List[str] | None = None
51
 
52
  class Message(BaseModel):
53
  npc: str | None = None
 
214
 
215
  return StreamingResponse(audio_stream(),media_type="audio/mpeg")
216
  @app.get("/generate_song")
217
+ async def generate_song(text: SongRequest):
218
  song_lyrics=generate_lyrics({
219
+ "prompt": f"{text.prompt}",
220
  })
221
  data = custom_generate_audio({
222
  "prompt": song_lyrics['text'],