Update app.py
Browse files
app.py
CHANGED
|
@@ -5,6 +5,7 @@ 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 |
|
| 9 |
# Préprompt amélioré pour une meilleure structuration
|
| 10 |
PREPROMPT = """Vous êtes un assistant IA chargé de générer une présentation PowerPoint. Générez une présentation structurée en suivant ce format EXACT:
|
|
@@ -53,7 +54,9 @@ Analysez le texte suivant et créez une présentation claire et professionnelle
|
|
| 53 |
# Authentification Necessaire
|
| 54 |
#https://huggingface.co/docs/hub/spaces-overview#managing-secrets
|
| 55 |
#https://huggingface.co/docs/hub/security-tokens
|
|
|
|
| 56 |
token = os.getenv('Authentification_HF')
|
|
|
|
| 57 |
model_id = "mistralai/Mistral-Nemo-Instruct-2407"
|
| 58 |
|
| 59 |
# Initialisation du modèle avec des paramètres de contexte plus grands
|
|
|
|
| 5 |
from pptx import Presentation
|
| 6 |
from pptx.util import Inches, Pt
|
| 7 |
from pptx.enum.text import PP_ALIGN
|
| 8 |
+
from huggingface_hub import login
|
| 9 |
|
| 10 |
# Préprompt amélioré pour une meilleure structuration
|
| 11 |
PREPROMPT = """Vous êtes un assistant IA chargé de générer une présentation PowerPoint. Générez une présentation structurée en suivant ce format EXACT:
|
|
|
|
| 54 |
# Authentification Necessaire
|
| 55 |
#https://huggingface.co/docs/hub/spaces-overview#managing-secrets
|
| 56 |
#https://huggingface.co/docs/hub/security-tokens
|
| 57 |
+
#from huggingface_hub import login
|
| 58 |
token = os.getenv('Authentification_HF')
|
| 59 |
+
login(token)
|
| 60 |
model_id = "mistralai/Mistral-Nemo-Instruct-2407"
|
| 61 |
|
| 62 |
# Initialisation du modèle avec des paramètres de contexte plus grands
|