Sayoyo commited on
Commit
9e4bff7
·
1 Parent(s): 1bea0d0

feat: api result add model name

Browse files
Files changed (1) hide show
  1. acestep/api_server.py +10 -0
acestep/api_server.py CHANGED
@@ -148,6 +148,10 @@ class JobResult(BaseModel):
148
  genres: Optional[str] = None
149
  keyscale: Optional[str] = None
150
  timesignature: Optional[str] = None
 
 
 
 
151
 
152
 
153
  class JobResponse(BaseModel):
@@ -695,6 +699,10 @@ def create_app() -> FastAPI:
695
  return None
696
  return s
697
 
 
 
 
 
698
  return {
699
  "first_audio_path": _path_to_audio_url(first_audio) if first_audio else None,
700
  "second_audio_path": _path_to_audio_url(second_audio) if second_audio else None,
@@ -708,6 +716,8 @@ def create_app() -> FastAPI:
708
  "genres": _none_if_na_str(metas_out.get("genres")),
709
  "keyscale": _none_if_na_str(metas_out.get("keyscale")),
710
  "timesignature": _none_if_na_str(metas_out.get("timesignature")),
 
 
711
  }
712
 
713
  t0 = time.time()
 
148
  genres: Optional[str] = None
149
  keyscale: Optional[str] = None
150
  timesignature: Optional[str] = None
151
+
152
+ # Model information
153
+ lm_model: Optional[str] = None
154
+ dit_model: Optional[str] = None
155
 
156
 
157
  class JobResponse(BaseModel):
 
699
  return None
700
  return s
701
 
702
+ # Get model information from environment variables
703
+ lm_model_name = os.getenv("ACESTEP_LM_MODEL_PATH", "acestep-5Hz-lm-0.6B-v3")
704
+ dit_model_name = os.getenv("ACESTEP_CONFIG_PATH", "acestep-v15-turbo-rl")
705
+
706
  return {
707
  "first_audio_path": _path_to_audio_url(first_audio) if first_audio else None,
708
  "second_audio_path": _path_to_audio_url(second_audio) if second_audio else None,
 
716
  "genres": _none_if_na_str(metas_out.get("genres")),
717
  "keyscale": _none_if_na_str(metas_out.get("keyscale")),
718
  "timesignature": _none_if_na_str(metas_out.get("timesignature")),
719
+ "lm_model": lm_model_name,
720
+ "dit_model": dit_model_name,
721
  }
722
 
723
  t0 = time.time()