Update app.py
Browse files
app.py
CHANGED
@@ -88,16 +88,19 @@ def calculate_generation_params(lyrics):
|
|
88 |
}
|
89 |
|
90 |
# ๊ฐ ์น์
๋ณ ์์ ์๊ฐ ๊ณ์ฐ
|
91 |
-
section_durations = {
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
|
|
|
|
96 |
|
97 |
-
|
|
|
98 |
total_duration = max(60, total_duration) # ์ต์ 60์ด
|
99 |
|
100 |
-
# ํ ํฐ ๊ณ์ฐ
|
101 |
base_tokens = 3000 # ๊ธฐ๋ณธ ํ ํฐ ์
|
102 |
tokens_per_line = 200 # ์ค๋น ํ ํฐ ์
|
103 |
|
|
|
88 |
}
|
89 |
|
90 |
# ๊ฐ ์น์
๋ณ ์์ ์๊ฐ ๊ณ์ฐ
|
91 |
+
section_durations = {}
|
92 |
+
for section_type in ['verse', 'chorus', 'bridge']:
|
93 |
+
# ๊ฐ ์น์
์ ๋ผ์ธ ์์ ํด๋น ์น์
์ ์๊ฐ์ ๊ณฑํจ
|
94 |
+
if isinstance(section_lines[section_type], list):
|
95 |
+
section_durations[section_type] = len(section_lines[section_type]) * time_per_line[section_type]
|
96 |
+
else:
|
97 |
+
section_durations[section_type] = section_lines[section_type] * time_per_line[section_type]
|
98 |
|
99 |
+
# ์ ์ฒด ์๊ฐ ๊ณ์ฐ
|
100 |
+
total_duration = sum(duration for duration in section_durations.values())
|
101 |
total_duration = max(60, total_duration) # ์ต์ 60์ด
|
102 |
|
103 |
+
# ํ ํฐ ๊ณ์ฐ
|
104 |
base_tokens = 3000 # ๊ธฐ๋ณธ ํ ํฐ ์
|
105 |
tokens_per_line = 200 # ์ค๋น ํ ํฐ ์
|
106 |
|