Update app.py
Browse files
app.py
CHANGED
|
@@ -1,15 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import os
|
| 2 |
import gradio as gr
|
| 3 |
from huggingface_hub import hf_hub_download, login
|
| 4 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 5 |
from pptx import Presentation
|
| 6 |
from pptx.util import Inches, Pt
|
| 7 |
-
from pptx.enum.text import PP_ALIGN
|
| 8 |
import torch
|
| 9 |
from llama_cpp import Llama
|
| 10 |
import time
|
| 11 |
|
| 12 |
-
#
|
| 13 |
TEXT_MODELS = {
|
| 14 |
"Mistral Nemo 2407 (GGUF)": "MisterAI/Bartowski_MistralAI_Mistral-Nemo-Instruct-2407-IQ4_XS.gguf",
|
| 15 |
"Mixtral 8x7B": "mistralai/Mixtral-8x7B-v0.1",
|
|
@@ -197,68 +201,10 @@ def generate_presentation_with_progress(text, text_model_name, temperature, max_
|
|
| 197 |
print(f"Erreur lors de la génération: {str(e)}")
|
| 198 |
return f"Erreur: {str(e)}", None, None
|
| 199 |
|
| 200 |
-
|
| 201 |
-
css = """
|
| 202 |
-
/* Thème sombre personnalisé */
|
| 203 |
-
.gradio-container {
|
| 204 |
-
background-color: #000000 !important;
|
| 205 |
-
color: #ffffff !important;
|
| 206 |
-
}
|
| 207 |
-
|
| 208 |
-
.gr-form, .gr-box, .gr-panel {
|
| 209 |
-
border-radius: 8px !important;
|
| 210 |
-
background-color: #1a1a1a !important;
|
| 211 |
-
border: 1px solid #333333 !important;
|
| 212 |
-
color: #ffffff !important;
|
| 213 |
-
}
|
| 214 |
-
|
| 215 |
-
.gr-input, .gr-textarea, .gr-dropdown {
|
| 216 |
-
background-color: #2d2d2d !important;
|
| 217 |
-
color: #ffffff !important;
|
| 218 |
-
border: 1px solid #404040 !important;
|
| 219 |
-
}
|
| 220 |
-
|
| 221 |
-
.gr-button {
|
| 222 |
-
background-color: #2d2d2d !important;
|
| 223 |
-
color: #ffffff !important;
|
| 224 |
-
border: 1px solid #404040 !important;
|
| 225 |
-
transition: all 0.3s ease !important;
|
| 226 |
-
}
|
| 227 |
-
|
| 228 |
-
.gr-button:hover {
|
| 229 |
-
background-color: #404040 !important;
|
| 230 |
-
transform: translateY(-2px) !important;
|
| 231 |
-
}
|
| 232 |
-
|
| 233 |
-
/* Textes et labels */
|
| 234 |
-
h1, h2, h3, p, label, .gr-text {
|
| 235 |
-
color: #ffffff !important;
|
| 236 |
-
}
|
| 237 |
-
|
| 238 |
-
/* Scrollbar */
|
| 239 |
-
::-webkit-scrollbar {
|
| 240 |
-
width: 8px;
|
| 241 |
-
height: 8px;
|
| 242 |
-
}
|
| 243 |
-
|
| 244 |
-
::-webkit-scrollbar-track {
|
| 245 |
-
background: #1a1a1a;
|
| 246 |
-
}
|
| 247 |
-
|
| 248 |
-
::-webkit-scrollbar-thumb {
|
| 249 |
-
background: #404040;
|
| 250 |
-
border-radius: 4px;
|
| 251 |
-
}
|
| 252 |
-
|
| 253 |
-
::-webkit-scrollbar-thumb:hover {
|
| 254 |
-
background: #4a4a4a;
|
| 255 |
-
}
|
| 256 |
-
"""
|
| 257 |
-
|
| 258 |
-
with gr.Blocks(theme=gr.themes.Default(), css=css) as demo:
|
| 259 |
gr.Markdown(
|
| 260 |
"""
|
| 261 |
-
#
|
| 262 |
|
| 263 |
Créez des présentations professionnelles automatiquement avec l'aide de l'IA.
|
| 264 |
"""
|
|
@@ -295,7 +241,7 @@ with gr.Blocks(theme=gr.themes.Default(), css=css) as demo:
|
|
| 295 |
)
|
| 296 |
|
| 297 |
with gr.Row():
|
| 298 |
-
generate_btn = gr.Button("
|
| 299 |
|
| 300 |
with gr.Row():
|
| 301 |
with gr.Column():
|
|
|
|
| 1 |
+
#https://huggingface.co/spaces/MisterAI/GenDoc_05
|
| 2 |
+
#143
|
| 3 |
+
|
| 4 |
+
|
| 5 |
+
|
| 6 |
import os
|
| 7 |
import gradio as gr
|
| 8 |
from huggingface_hub import hf_hub_download, login
|
| 9 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 10 |
from pptx import Presentation
|
| 11 |
from pptx.util import Inches, Pt
|
|
|
|
| 12 |
import torch
|
| 13 |
from llama_cpp import Llama
|
| 14 |
import time
|
| 15 |
|
| 16 |
+
# Configuration des modèles et PREPROMPT
|
| 17 |
TEXT_MODELS = {
|
| 18 |
"Mistral Nemo 2407 (GGUF)": "MisterAI/Bartowski_MistralAI_Mistral-Nemo-Instruct-2407-IQ4_XS.gguf",
|
| 19 |
"Mixtral 8x7B": "mistralai/Mixtral-8x7B-v0.1",
|
|
|
|
| 201 |
print(f"Erreur lors de la génération: {str(e)}")
|
| 202 |
return f"Erreur: {str(e)}", None, None
|
| 203 |
|
| 204 |
+
with gr.Blocks() as demo:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 205 |
gr.Markdown(
|
| 206 |
"""
|
| 207 |
+
# Générateur de Présentations PowerPoint IA
|
| 208 |
|
| 209 |
Créez des présentations professionnelles automatiquement avec l'aide de l'IA.
|
| 210 |
"""
|
|
|
|
| 241 |
)
|
| 242 |
|
| 243 |
with gr.Row():
|
| 244 |
+
generate_btn = gr.Button("Générer la présentation", variant="primary")
|
| 245 |
|
| 246 |
with gr.Row():
|
| 247 |
with gr.Column():
|