Spaces:
Running
on
A100
Running
on
A100
fix: cot_caption
Browse files- acestep/api_server.py +14 -6
acestep/api_server.py
CHANGED
|
@@ -636,10 +636,21 @@ def create_app() -> FastAPI:
|
|
| 636 |
# Determine if LLM is needed
|
| 637 |
thinking = bool(req.thinking)
|
| 638 |
sample_mode = bool(req.sample_mode)
|
| 639 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 640 |
|
| 641 |
-
print(f"[api_server] Request params: req.thinking={req.thinking}, req.sample_mode={req.sample_mode}")
|
| 642 |
-
print(f"[api_server] Determined: thinking={thinking}, sample_mode={sample_mode}, need_llm={need_llm}")
|
| 643 |
|
| 644 |
# Ensure LLM is ready if needed
|
| 645 |
if need_llm:
|
|
@@ -655,9 +666,6 @@ def create_app() -> FastAPI:
|
|
| 655 |
time_signature = req.time_signature
|
| 656 |
audio_duration = req.audio_duration
|
| 657 |
|
| 658 |
-
# Check if sample_query (description) is provided for create_sample
|
| 659 |
-
has_sample_query = bool(req.sample_query and req.sample_query.strip())
|
| 660 |
-
|
| 661 |
if sample_mode or has_sample_query:
|
| 662 |
if has_sample_query:
|
| 663 |
# Use create_sample() with description query
|
|
|
|
| 636 |
# Determine if LLM is needed
|
| 637 |
thinking = bool(req.thinking)
|
| 638 |
sample_mode = bool(req.sample_mode)
|
| 639 |
+
has_sample_query = bool(req.sample_query and req.sample_query.strip())
|
| 640 |
+
use_format = bool(req.use_format)
|
| 641 |
+
use_cot_caption = bool(req.use_cot_caption)
|
| 642 |
+
use_cot_language = bool(req.use_cot_language)
|
| 643 |
+
|
| 644 |
+
# LLM is needed for:
|
| 645 |
+
# - thinking mode (LM generates audio codes)
|
| 646 |
+
# - sample_mode (LM generates random caption/lyrics/metas)
|
| 647 |
+
# - sample_query/description (LM generates from description)
|
| 648 |
+
# - use_format (LM enhances caption/lyrics)
|
| 649 |
+
# - use_cot_caption or use_cot_language (LM enhances metadata)
|
| 650 |
+
need_llm = thinking or sample_mode or has_sample_query or use_format or use_cot_caption or use_cot_language
|
| 651 |
|
| 652 |
+
print(f"[api_server] Request params: req.thinking={req.thinking}, req.sample_mode={req.sample_mode}, req.use_cot_caption={req.use_cot_caption}, req.use_cot_language={req.use_cot_language}, req.use_format={req.use_format}")
|
| 653 |
+
print(f"[api_server] Determined: thinking={thinking}, sample_mode={sample_mode}, use_cot_caption={use_cot_caption}, use_cot_language={use_cot_language}, use_format={use_format}, need_llm={need_llm}")
|
| 654 |
|
| 655 |
# Ensure LLM is ready if needed
|
| 656 |
if need_llm:
|
|
|
|
| 666 |
time_signature = req.time_signature
|
| 667 |
audio_duration = req.audio_duration
|
| 668 |
|
|
|
|
|
|
|
|
|
|
| 669 |
if sample_mode or has_sample_query:
|
| 670 |
if has_sample_query:
|
| 671 |
# Use create_sample() with description query
|