@danhachuel/thunderbolt 0.7.55 → 0.7.56
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/main.py +63 -1
- package/package.json +1 -1
package/app/main.py
CHANGED
|
@@ -8811,7 +8811,7 @@ def render_settings():
|
|
|
8811
8811
|
key=f"settings_{key}",
|
|
8812
8812
|
)
|
|
8813
8813
|
|
|
8814
|
-
api_keys_tab, upload_api_keys_tab, ai_influencers_tab, voice_test_tab = render_localized_tabs(["API Keys", "API Keys Upload", "AI Influencers", "Teste de Voz"])
|
|
8814
|
+
api_keys_tab, upload_api_keys_tab, subtitles_tab, ai_influencers_tab, voice_test_tab = render_localized_tabs(["API Keys", "API Keys Upload", "Legendas", "AI Influencers", "Teste de Voz"])
|
|
8815
8815
|
|
|
8816
8816
|
with api_keys_tab:
|
|
8817
8817
|
with st.container(border=True):
|
|
@@ -9191,6 +9191,68 @@ def render_settings():
|
|
|
9191
9191
|
write_json("settings.json", settings)
|
|
9192
9192
|
st.success("Postiz guardado.")
|
|
9193
9193
|
st.rerun()
|
|
9194
|
+
with subtitles_tab:
|
|
9195
|
+
st.subheader("Legendas")
|
|
9196
|
+
st.caption("Escolha como o motor de vídeo gera as legendas. A configuração só é alterada quando clicar em guardar.")
|
|
9197
|
+
st.markdown("### Os dois modos de geração")
|
|
9198
|
+
st.markdown("O projecto oferece duas abordagens principais para criar as legendas:")
|
|
9199
|
+
st.table([
|
|
9200
|
+
{"Modo": "edge", "Velocidade": "Rápida", "Requisitos de Hardware": "Nenhum (roda em CPU)", "Qualidade": "Pode ser instável"},
|
|
9201
|
+
{"Modo": "whisper", "Velocidade": "Lenta", "Requisitos de Hardware": "Alta (GPU recomendada)", "Qualidade": "Mais confiável"},
|
|
9202
|
+
])
|
|
9203
|
+
subtitle_provider_options = ["edge", "whisper"]
|
|
9204
|
+
current_subtitle_provider = str(settings.get("subtitle_provider") or "edge").strip().lower()
|
|
9205
|
+
if current_subtitle_provider not in subtitle_provider_options:
|
|
9206
|
+
current_subtitle_provider = "edge"
|
|
9207
|
+
subtitle_provider = st.radio(
|
|
9208
|
+
"Modo de geração",
|
|
9209
|
+
subtitle_provider_options,
|
|
9210
|
+
index=subtitle_provider_options.index(current_subtitle_provider),
|
|
9211
|
+
format_func=lambda value: f"{value} — {'Rápida, CPU, pode ser instável' if value == 'edge' else 'Lenta, GPU recomendada, mais confiável'}",
|
|
9212
|
+
horizontal=True,
|
|
9213
|
+
key="subtitle_provider_ui",
|
|
9214
|
+
)
|
|
9215
|
+
st.caption("A escolha é feita alterando a propriedade `subtitle_provider` no `config.toml`.")
|
|
9216
|
+
whisper_cols = st.columns(3)
|
|
9217
|
+
with whisper_cols[0]:
|
|
9218
|
+
whisper_model_size = st.selectbox(
|
|
9219
|
+
"Modelo Whisper",
|
|
9220
|
+
["tiny", "base", "small", "medium", "large-v3"],
|
|
9221
|
+
index=["tiny", "base", "small", "medium", "large-v3"].index(str(settings.get("whisper_model_size") or "large-v3")) if str(settings.get("whisper_model_size") or "large-v3") in ["tiny", "base", "small", "medium", "large-v3"] else 4,
|
|
9222
|
+
key="subtitle_whisper_model_size",
|
|
9223
|
+
)
|
|
9224
|
+
with whisper_cols[1]:
|
|
9225
|
+
whisper_device = st.selectbox(
|
|
9226
|
+
"Dispositivo Whisper",
|
|
9227
|
+
["cpu", "cuda"],
|
|
9228
|
+
index=["cpu", "cuda"].index(str(settings.get("whisper_device") or "cpu")) if str(settings.get("whisper_device") or "cpu") in ["cpu", "cuda"] else 0,
|
|
9229
|
+
key="subtitle_whisper_device",
|
|
9230
|
+
)
|
|
9231
|
+
with whisper_cols[2]:
|
|
9232
|
+
whisper_compute_type = st.selectbox(
|
|
9233
|
+
"Tipo de cálculo Whisper",
|
|
9234
|
+
["int8", "float16", "float32"],
|
|
9235
|
+
index=["int8", "float16", "float32"].index(str(settings.get("whisper_compute_type") or "int8")) if str(settings.get("whisper_compute_type") or "int8") in ["int8", "float16", "float32"] else 0,
|
|
9236
|
+
key="subtitle_whisper_compute_type",
|
|
9237
|
+
)
|
|
9238
|
+
if st.button("Guardar configuração de legendas", type="primary", width="stretch", key="save_subtitle_settings"):
|
|
9239
|
+
settings.update({
|
|
9240
|
+
"subtitle_provider": subtitle_provider,
|
|
9241
|
+
"whisper_model_size": whisper_model_size,
|
|
9242
|
+
"whisper_device": whisper_device,
|
|
9243
|
+
"whisper_compute_type": whisper_compute_type,
|
|
9244
|
+
})
|
|
9245
|
+
write_json("settings.json", settings)
|
|
9246
|
+
subtitle_moneyprinter_path = str(settings.get("moneyprinter_path") or "").strip()
|
|
9247
|
+
if subtitle_moneyprinter_path:
|
|
9248
|
+
try:
|
|
9249
|
+
synced = sync_moneyprinter_config(settings, subtitle_moneyprinter_path)
|
|
9250
|
+
st.success(f"Configuração de legendas guardada{f' e sincronizada com {synced}' if synced else ''}.")
|
|
9251
|
+
except Exception as exc:
|
|
9252
|
+
st.warning(f"Configuração de legendas guardada localmente, mas não foi possível sincronizar config.toml: {exc}")
|
|
9253
|
+
else:
|
|
9254
|
+
st.success("Configuração de legendas guardada localmente.")
|
|
9255
|
+
|
|
9194
9256
|
with ai_influencers_tab:
|
|
9195
9257
|
st.subheader("AI Influencers")
|
|
9196
9258
|
st.caption("Estado do backend usado por Personagens e Geração de Conteúdo IA. O selector e as credenciais são editados nesta aba, em Banco de Dados Influencers.")
|
package/package.json
CHANGED