Spaces:
Running
Running
Update app.py
Browse filesSubstituí o gr.Markdown simples nas abas "Configurações" e "Sobre" por gr.HTML, usando CSS embutido para criar cards e listas que combinam com a paleta de cores
app.py
CHANGED
|
@@ -1441,59 +1441,86 @@ with gr.Blocks(theme=custom_theme, title="Gerador de Posts e Chatbot (Completo)"
|
|
| 1441 |
resetar_analytics_btn_confirm = gr.Button("Confirmar Reset", visible=False, elem_id="reset_confirm_hidden_btn")
|
| 1442 |
|
| 1443 |
with gr.TabItem("⚙️ Configurações", id=4):
|
| 1444 |
-
|
| 1445 |
-
gr.
|
| 1446 |
-
|
| 1447 |
-
|
| 1448 |
-
|
| 1449 |
-
|
| 1450 |
-
|
| 1451 |
-
|
| 1452 |
-
|
| 1453 |
-
|
| 1454 |
-
|
| 1455 |
-
|
| 1456 |
-
|
| 1457 |
-
|
| 1458 |
-
|
| 1459 |
-
|
| 1460 |
-
|
| 1461 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1462 |
|
| 1463 |
with gr.TabItem("ℹ️ Sobre", id=5):
|
| 1464 |
-
|
| 1465 |
-
|
| 1466 |
-
|
| 1467 |
-
|
| 1468 |
-
|
| 1469 |
-
|
| 1470 |
-
|
| 1471 |
-
|
| 1472 |
-
|
| 1473 |
-
|
| 1474 |
-
|
| 1475 |
-
|
| 1476 |
-
|
| 1477 |
-
|
| 1478 |
-
|
| 1479 |
-
|
| 1480 |
-
|
| 1481 |
-
|
| 1482 |
-
|
| 1483 |
-
|
| 1484 |
-
|
| 1485 |
-
|
| 1486 |
-
|
| 1487 |
-
|
| 1488 |
-
|
| 1489 |
-
|
| 1490 |
-
|
| 1491 |
-
|
| 1492 |
-
|
| 1493 |
-
|
| 1494 |
-
|
| 1495 |
-
|
| 1496 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1497 |
""")
|
| 1498 |
|
| 1499 |
# ============================================
|
|
|
|
| 1441 |
resetar_analytics_btn_confirm = gr.Button("Confirmar Reset", visible=False, elem_id="reset_confirm_hidden_btn")
|
| 1442 |
|
| 1443 |
with gr.TabItem("⚙️ Configurações", id=4):
|
| 1444 |
+
# MELHORIA: Substituído Markdown por HTML
|
| 1445 |
+
gr.HTML(
|
| 1446 |
+
"""
|
| 1447 |
+
<div style='padding: 16px; background-color: #f9fafb; border-radius: 8px;'>
|
| 1448 |
+
<h3 style='color: #1e3a8a; font-size: 1.25rem; font-weight: 600; margin-bottom: 12px;'>Configurações do Gerador</h3>
|
| 1449 |
+
<div style='background-color: white; border: 1px solid #e5e7eb; border-radius: 8px; padding: 16px;'>
|
| 1450 |
+
<p style='margin-bottom: 8px;'><strong>Modelo de Texto (LLM):</strong> Llama 3.1 8B (Usado para Posts e Chatbot)</p>
|
| 1451 |
+
<p style='margin-bottom: 8px;'><strong>Modelos de Imagem:</strong> FLUX.1-schnell, FLUX.1-dev, SDXL 1.0</p>
|
| 1452 |
+
<p style='margin-bottom: 8px;'><strong>Modelo de Tradução (PT -> EN):</strong> Helsinki-NLP/opus-mt-pt-en</p>
|
| 1453 |
+
<p style='margin-bottom: 8px;'><strong>API Provider:</strong> Hugging Face Inference</p>
|
| 1454 |
+
<p style='margin-bottom: 0;'><strong>Database:</strong> Google Firestore (via Firebase Admin)</p>
|
| 1455 |
+
</div>
|
| 1456 |
+
|
| 1457 |
+
<h4 style='color: #1e3a8a; font-size: 1.1rem; font-weight: 600; margin-top: 16px; margin-bottom: 12px;'>Funcionalidades (Versão Completa):</h4>
|
| 1458 |
+
<ul style='list-style-type: disc; margin-left: 20px; background-color: white; border: 1px solid #e5e7eb; border-radius: 8px; padding: 16px 16px 16px 32px;'>
|
| 1459 |
+
<li style='margin-bottom: 6px;'><strong>Gerador de Posts:</strong> Cria posts completos com texto e imagem.</li>
|
| 1460 |
+
<li style='margin-bottom: 6px;'><strong>Seleção de Formato:</strong> Permite escolher o formato (Instagram, Twitter, LinkedIn, WhatsApp).</li>
|
| 1461 |
+
<li style='margin-bottom: 6px;'><strong>Controles Avançados:</strong> Permite seleção de Estilo, Qualidade e Filtros para a imagem.</li>
|
| 1462 |
+
<li style='margin-bottom: 6px;'><strong>Download de Post:</strong> Baixa um .zip com .txt e .png.</li>
|
| 1463 |
+
<li style='margin-bottom: 6px;'><strong>Chatbot Assistente:</strong> Converse com a IA para ideias e perguntas rápidas.</li>
|
| 1464 |
+
<li style='margin-bottom: 6px;'><strong>Histórico Persistente:</strong> Salva os posts gerados no Firestore.</li>
|
| 1465 |
+
<li style='margin-bottom: 6px;'><strong>Busca no Histórico:</strong> Permite buscar e filtrar posts antigos.</li>
|
| 1466 |
+
<li style='margin-bottom: 6px;'><strong>Favoritos:</strong> Permite marcar posts como favoritos.</li>
|
| 1467 |
+
<li style='margin-bottom: 6px;'><strong>Sistema de Cache:</strong> Salva posts localmente para acelerar requisições.</li>
|
| 1468 |
+
<li style='margin-bottom: 0;'><strong>Sistema de Analytics:</strong> Rastreia o uso (total, por nicho, etc.) no Firestore.</li>
|
| 1469 |
+
</ul>
|
| 1470 |
+
</div>
|
| 1471 |
+
"""
|
| 1472 |
+
)
|
| 1473 |
|
| 1474 |
with gr.TabItem("ℹ️ Sobre", id=5):
|
| 1475 |
+
# MELHORIA: Substituído Markdown por HTML
|
| 1476 |
+
gr.HTML(
|
| 1477 |
+
"""
|
| 1478 |
+
<div style='padding: 16px; background-color: #f9fafb; border-radius: 8px;'>
|
| 1479 |
+
<h3 style='color: #1e3a8a; font-size: 1.25rem; font-weight: 600; margin-bottom: 12px;'>Sobre Este Projeto</h3>
|
| 1480 |
+
<div style='background-color: white; border: 1px solid #e5e7eb; border-radius: 8px; padding: 16px;'>
|
| 1481 |
+
<p style='margin-bottom: 12px;'>Este gerador foi desenvolvido no <strong>Curso de Python com IA</strong>.</p>
|
| 1482 |
+
|
| 1483 |
+
<h4 style='color: #1e3a8a; font-size: 1.1rem; font-weight: 600; margin-top: 12px; margin-bottom: 8px;'>Tecnologias:</h4>
|
| 1484 |
+
<ul style='list-style-type: disc; margin-left: 20px; padding-left: 16px;'>
|
| 1485 |
+
<li style='margin-bottom: 4px;'>Hugging Face Spaces (hospedagem)</li>
|
| 1486 |
+
<li style='margin-bottom: 4px;'>Gradio (interface web)</li>
|
| 1487 |
+
<li style='margin-bottom: 4px;'><strong>Llama 3.1 8B</strong> (geração de texto e chatbot)</li>
|
| 1488 |
+
<li style='margin-bottom: 4px;'><strong>FLUX.1 & SDXL</strong> (geração de imagens)</li>
|
| 1489 |
+
<li style='margin-bottom: 4px;'>Opus-MT (tradução)</li>
|
| 1490 |
+
<li style='margin-bottom: 4px;'><strong>Firebase Firestore</strong> (Banco de Dados & Analytics)</li>
|
| 1491 |
+
<li style='margin-bottom: 4px;'><strong>PIL</strong> (composição de posts)</li>
|
| 1492 |
+
<li style='margin-bottom: 4px;'>Cache local (para performance)</li>
|
| 1493 |
+
<li style='margin-bottom: 4px;'>CSV & ZIP (para exportação)</li>
|
| 1494 |
+
</ul>
|
| 1495 |
+
|
| 1496 |
+
<h4 style='color: #1e3a8a; font-size: 1.1rem; font-weight: 600; margin-top: 16px; margin-bottom: 8px;'>Como funciona:</h4>
|
| 1497 |
+
<ol style='list-style-type: decimal; margin-left: 20px; padding-left: 16px;'>
|
| 1498 |
+
<li style='margin-bottom: 4px;'><strong>Gerar Post:</strong> Você define o tema, nicho, estilo e formato.</li>
|
| 1499 |
+
<li style='margin-bottom: 4px;'><strong>Imagem (Opcional):</strong> Você ativa e seleciona Estilo, Qualidade e Filtro.</li>
|
| 1500 |
+
<li style='margin-bottom: 4px;'><strong>Refinar (Opcional):</strong> Clique em "Refinar Post" para editar o texto gerado.</li>
|
| 1501 |
+
<li style='margin-bottom: 4px;'><strong>Download:</strong> Baixe um .zip com o texto e a imagem.</li>
|
| 1502 |
+
<li style='margin-bottom: 4px;'><strong>Histórico & Analytics:</strong> Os posts são salvos no Firestore.</li>
|
| 1503 |
+
<li style='margin-bottom: 4px;'><strong>Exportar:</strong> Na aba "Histórico", exporte seus dados como CSV.</li>
|
| 1504 |
+
</ol>
|
| 1505 |
+
|
| 1506 |
+
<p style='margin-top: 16px; font-weight: 600;'><strong>Desenvolvido por:</strong> Wilder Paz</p>
|
| 1507 |
+
</div>
|
| 1508 |
+
</div>
|
| 1509 |
+
"""
|
| 1510 |
+
)
|
| 1511 |
+
|
| 1512 |
+
# MELHORIA: Rodapé atualizado para HTML
|
| 1513 |
+
gr.HTML("""
|
| 1514 |
+
<div>
|
| 1515 |
+
<div style='padding: 12px; background-color: #eef2ff; border: 1px solid #dbeafe; border-radius: 8px; text-align: center; margin-top: 16px;'>
|
| 1516 |
+
<p style='font-weight: 600; color: #3730a3; margin: 0;'>
|
| 1517 |
+
Se você gosta dos nossos resultados de Geração de Posts e Chatbot, por favor, dê-nos uma ⭐ no nosso Space!
|
| 1518 |
+
</p>
|
| 1519 |
+
</div>
|
| 1520 |
+
<p style='text-align: center; font-size: 0.9rem; color: #6b7280; margin-top: 12px;'>
|
| 1521 |
+
<strong>Curso de Python com IA</strong> | 🤖 Desenvolvido com Llama 3.1 & FLUX | ⚡ Hugging Face Spaces + Gradio + Firestore + Cache + Analytics
|
| 1522 |
+
</p>
|
| 1523 |
+
</div>
|
| 1524 |
""")
|
| 1525 |
|
| 1526 |
# ============================================
|