Affichage des articles dont le libellé est installation. Afficher tous les articles
Affichage des articles dont le libellé est installation. Afficher tous les articles

vendredi 5 septembre 2025

Comment installer Apertus.

 Exemple non encore validé

Tu peux tester le modèle Apertus-8B-Instruct-2509 de Hugging Face de deux façons principales : localement avec Transformers, ou via l’interface web Hugging Face (si le modèle est déployé). Voici un guide complet pour chaque méthode :

🧪 1. Test local avec Transformers (Python) Prérequis : GPU avec au moins 24 Go de VRAM (type RTX 3090 ou A100), ou usage via bitsandbytes pour quantisation.

🌐 2. Interface web Hugging Face (si disponible)

Tu peux visiter la pour voir s’il propose une démo interactive. Si le bouton “Hosted inference API” ou “Try it out” est absent, cela signifie que le modèle n’est pas déployé pour test direct en ligne

Pour utiliser le modèle Apertus-8B-Instruct-2509 avec Azure, tu peux envisager deux approches selon ton architecture :

🧩 1. Déploiement local + Azure Container / VM

☁️ 2. Intégration dans Azure AI Foundry / OpenAI Evaluation

1️⃣ Installer l’outil huggingface-cli

Si ce n’est pas déjà fait, installe la bibliothèque huggingface_hub (qui contient huggingface-cli) :

pip install -U huggingface_hub

2️⃣ S’authentifier auprès de Hugging Face

Certains modèles (comme Apertus-8B-2509) nécessitent d’être connecté à ton compte Hugging Face et d’avoir accepté les conditions d’utilisation du modèle sur sa page.

Puis, dans ton terminal :

huggingface-cli login

Colle ton token quand il est demandé.


3️⃣ Télécharger le modèle

Une fois connecté, exécute ta commande :

huggingface-cli download swiss-ai/Apertus-8B-2509 --local-dir ./apertus-8b

💡 Notes importantes :

  • --local-dir indique où stocker les fichiers du modèle.
  • Si tu veux forcer le téléchargement complet (et pas juste les métadonnées), ajoute --include "*".
  • Si tu veux éviter la mise en cache globale de HF, ajoute --local-dir-use-symlinks False.

Exemple complet :

huggingface-cli download swiss-ai/Apertus-8B-2509 \
  --local-dir ./apertus-8b \
  --local-dir-use-symlinks False \
  --include "*"

4️⃣ Vérifier le contenu

Après téléchargement, tu devrais voir dans ./apertus-8b :

  • config.json
  • tokenizer.json / tokenizer.model
  • pytorch_model-*.bin ou model.safetensors
  • éventuellement des fichiers de configuration supplémentaires


Pour accélérer le téléchargement d’un gros modèle Hugging Face comme swiss-ai/Apertus-8B-2509, il faut jouer sur trois leviers : réseau, méthode de transfert et paramètres CLI.

Voici un plan d’optimisation concret que tu peux appliquer directement.



🚀 1. Préparer l’environnement

  • Connexion filaire : évite le Wi‑Fi si possible, surtout pour des fichiers de plusieurs dizaines de Go.
  • Serveur proche : Hugging Face utilise un CDN, donc un bon peering avec ton FAI aide.
    Si tu es sur un serveur cloud (AWS, GCP, OVH…), choisis une région proche de l’Europe pour réduire la latence.
  • Limiter la concurrence réseau : ferme les autres téléchargements lourds pendant l’opération.

⚙️ 2. Optimiser la commande huggingface-cli

Par défaut, huggingface-cli download télécharge séquentiellement. Tu peux :

  1. Inclure tous les fichiers d’un coup (évite les requêtes multiples) :

    huggingface-cli download swiss-ai/Apertus-8B-2509 \
      --local-dir ./apertus-8b \
      --include "*" \
      --local-dir-use-symlinks False
    
  2. Téléchargement parallèle
    Le CLI ne gère pas nativement le multi-thread, mais tu peux combiner avec aria2c pour paralléliser (voir section 3).

  3. Reprise automatique
    Si la connexion coupe, relancer la même commande reprend là où ça s’est arrêté (grâce au cache HF).


🛠 3. Alternative ultra-rapide avec aria2c

aria2c est un téléchargeur multi-connexion qui peut diviser un gros fichier en segments parallèles.

  1. Installe-le :

    sudo apt install aria2   # Debian/Ubuntu
    brew install aria2       # macOS
    
  2. Récupère la liste des URLs directes depuis Hugging Face :

    huggingface-cli download swiss-ai/Apertus-8B-2509 --include "*" --local-dir ./apertus-8b --resume-download --quiet --token YOUR_HF_TOKEN --max-workers 1 --no-symlinks --output-dir-url
    

    (ou via la page du modèle → clic droit sur chaque fichier → “Copier le lien de téléchargement”)

  3. Lance aria2c avec plusieurs connexions :

    aria2c -x 16 -s 16 -k 1M -d ./apertus-8b "URL_DU_FICHIER"
    
    • -x 16 : 16 connexions simultanées
    • -s 16 : 16 segments
    • -k 1M : taille de segment 1 Mo

📦 4. Option Git LFS (si tu veux tout le repo)

Pour cloner tout le dépôt avec historique minimal :

GIT_LFS_SKIP_SMUDGE=1 git clone --depth 1 https://huggingface.co/swiss-ai/Apertus-8B-2509
cd Apertus-8B-2509
git lfs pull --include="*"

⚠️ Plus lourd que huggingface-cli si tu ne veux que les poids.


📋 5. Bonnes pratiques

  • Télécharger en heures creuses (nuit, tôt le matin) pour éviter la saturation réseau.
  • Vérifier l’espace disque avant (les modèles 8B peuvent dépasser 15–20 Go).
  • Utiliser un SSD pour éviter que l’écriture disque ne devienne le goulot d’étranglement.


Parfait, Erol — voici un script Bash complet qui combine huggingface-cli pour l’authentification et la récupération de la liste des fichiers, puis aria2c pour un téléchargement multi-connexion avec reprise automatique.
Il est pensé pour être robuste, reproductible et facile à maintenir.


📜 Script : download_apertus.sh

#!/usr/bin/env bash
set -euo pipefail

# === CONFIGURATION ===
REPO_ID="swiss-ai/Apertus-8B-2509"
LOCAL_DIR="./apertus-8b"
THREADS=16          # Connexions simultanées par fichier
SPLIT=16            # Segments par fichier
SEGMENT_SIZE="1M"   # Taille des segments
HF_TOKEN="${HF_TOKEN:-}"  # Peut être passé en variable d'env

# === PRÉREQUIS ===
command -v huggingface-cli >/dev/null || { echo "❌ huggingface-cli manquant. Installez-le avec : pip install -U huggingface_hub"; exit 1; }
command -v aria2c >/dev/null || { echo "❌ aria2c manquant. Installez-le avec : sudo apt install aria2 ou brew install aria2"; exit 1; }

# === AUTHENTIFICATION ===
if [[ -z "$HF_TOKEN" ]]; then
    echo "🔑 Connexion à Hugging Face..."
    huggingface-cli login
else
    echo "🔑 Utilisation du token HF depuis la variable d'environnement."
    huggingface-cli login --token "$HF_TOKEN" --add-to-git-credential
fi

# === CRÉATION DU DOSSIER LOCAL ===
mkdir -p "$LOCAL_DIR"

# === RÉCUPÉRATION DES URLS DIRECTES ===
echo "📥 Récupération de la liste des fichiers..."
FILE_LIST=$(huggingface-cli list-files "$REPO_ID" --include "*" | grep -v '/$')

# === TÉLÉCHARGEMENT AVEC aria2c ===
echo "🚀 Téléchargement parallèle avec aria2c..."
for FILE in $FILE_LIST; do
    URL="https://huggingface.co/${REPO_ID}/resolve/main/${FILE}?download=true"
    aria2c -x "$THREADS" -s "$SPLIT" -k "$SEGMENT_SIZE" \
           -d "$LOCAL_DIR" -o "$(basename "$FILE")" \
           --continue=true --max-connection-per-server="$THREADS" \
           --min-split-size="$SEGMENT_SIZE" \
           --header="Authorization: Bearer $HF_TOKEN" \
           "$URL"
done

echo "✅ Téléchargement terminé dans : $LOCAL_DIR"

🔹 Points forts

  • Reprise automatique (--continue=true)
  • Multi-connexion (-x et -s) pour saturer ta bande passante
  • Token Hugging Face géré soit par login interactif, soit via variable d’environnement HF_TOKEN
  • Indépendant du cache HF → fichiers directement dans ./apertus-8b
  • Facile à adapter pour d’autres modèles

📦 Utilisation

  1. Sauvegarde le script :

    nano download_apertus.sh
    # colle le contenu ci-dessus
    chmod +x download_apertus.sh
    
  2. Lance-le :

    ./download_apertus.sh
    

    ou avec un token déjà exporté :

    export HF_TOKEN="hf_xxx_ton_token_xxx"
    ./download_apertus.sh
    

💡 Astuce bonus :
Si tu veux vérifier l’intégrité après téléchargement, on peut ajouter un bloc qui calcule les SHA256 et les compare à ceux listés par huggingface-cli list-files --include "*".


Solution simplifiée en 3 étapes

1️⃣ Installer huggingface_hub

Ouvrez un terminal et installez l’outil officiel Hugging Face :

pip install -U huggingface_hub

python.exe -m pip install --upgrade pip

2️⃣ Se connecter à Hugging Face

huggingface-cli login

  • Cette commande télécharge dans le dossier ./apertus-8b.
  • Aucune option supplémentaire n’est requise pour un usage basique.

Pourquoi cette solution est plus simple ?

  • Pas besoin de gérer des options avancées comme --include "*" ou --local-dir-use-symlinks False (les valeurs par défaut fonctionnent bien pour la plupart des cas).
  • Pas de configuration complexe : juste une installation, une authentification et une commande de téléchargement.
  • Moins de risques d’erreurs : idéal pour les utilisateurs qui veulent juste récupérer le modèle sans optimisations poussées.

Vérification rapide

Après téléchargement, vérifiez que le dossier ./apertus-8b contient au moins :

  • config.json
  • tokenizer.json ou tokenizer.model
  • pytorch_model.bin ou model.safetensors

Alternative encore plus simple (si vous utilisez Python)

Si vous préférez éviter la ligne de commande, vous pouvez télécharger le modèle directement en Python avec la bibliothèque huggingface_hub :

from huggingface_hub import snapshot_download

snapshot_download(repo_id="swiss-ai/Apertus-8B-2509", local_dir="./apertus-8b")

Quand utiliser cette solution ?

  • Si vous débutez avec Hugging Face.
  • Si vous n’avez pas besoin d’optimiser la vitesse de téléchargement.
  • Si vous voulez éviter les options CLI complexes.


Ce code est déjà correct sur le principe, mais pour le faire tourner, il faut surtout préparer l’environnement et respecter quelques points spécifiques au modèle Apertus-8B-Instruct-2509.


Voici la marche à suivre pas à pas pour exécuter cette commande en local ou sur un serveur GPU.


1️⃣ Préparer l’environnement Python

Installe Python 3.10+ et crée un environnement virtuel :

python -m venv venv
source venv/bin/activate  # Linux/Mac
venv\Scripts\activate     # Windows

2️⃣ Installer les dépendances

Le modèle nécessite transformers ≥ 4.56.0 (sinon apply_chat_template ne sera pas reconnu) et PyTorch avec support GPU si tu veux utiliser cuda.

pip install --upgrade pip
pip install "transformers>=4.56.0" accelerate torch

Si tu veux la génération plus rapide :

pip install bitsandbytes  # pour chargement 8-bit/4-bit

3️⃣ Accepter les conditions d’utilisation sur Hugging Face

Le dépôt swiss-ai/Apertus-8B-Instruct-2509 est en accès restreint :

  • Connecte-toi sur la page du modèle
  • Clique sur "Agree and access repository"
  • Configure ton token HF :
huggingface-cli login

4️⃣ Lancer ton script

Enregistre ton code dans un fichier, par exemple apertus_test.py, puis exécute :

python apertus_test.py

5️⃣ Conseils pour éviter les erreurs

  • GPU obligatoire pour ce modèle en pleine précision (8B paramètres). Sur CPU, ça risque d’être très lent ou de planter par manque de RAM.
  • Si tu veux réduire la charge mémoire :
model = AutoModelForCausalLM.from_pretrained(
    model_name,
    device_map="auto",
    torch_dtype="auto",
    load_in_8bit=True  # ou load_in_4bit=True
)
  • max_new_tokens=32768 est énorme : commence plutôt avec max_new_tokens=512 pour tester.
  • Si tu veux un format conversationnel correct, apply_chat_template est bien, mais vérifie que le tokenizer du modèle supporte ce format.

💡 Astuce CI/CD (vu ton profil) :
Tu peux intégrer ce script dans un pipeline avec un test rapide (prompt court, génération limitée) pour valider que le modèle est accessible et fonctionnel avant de lancer des batchs plus lourds.

swiss-ai/Apertus-8B-Instruct-2509 · Hugging Face


Déploiement Azure :

Voici un template complet de déploiement Azure pour exécuter le modèle Hugging Face Apertus-8B-Instruct-2509 dans un environnement sécurisé et scalable. Ce modèle n’est pas disponible via l’inférence managée Hugging Face, donc tu dois le déployer manuellement dans Azure Machine Learning ou AKS.


🚀 Déploiement via Azure Machine Learning (AML)

📦 1. Dockerfile (GPU)

FROM nvidia/cuda:11.8.0-cudnn8-runtime-ubuntu22.04

RUN apt-get update && apt-get install -y \
    python3-pip git curl && \
    pip3 install --upgrade pip

RUN pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
RUN pip install transformers accelerate

WORKDIR /app
COPY . /app

CMD ["python3", "serve.py"]

🧠 2. serve.py (FastAPI wrapper)

from transformers import AutoTokenizer, AutoModelForCausalLM
from fastapi import FastAPI, Request
import torch

app = FastAPI()
model_id = "swiss-ai/Apertus-8B-Instruct-2509"

tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype=torch.bfloat16)

@app.post("/generate")
async def generate(request: Request):
    body = await request.json()
    prompt = body.get("inputs", "")
    inputs = tokenizer(prompt, return_tensors="pt")
    outputs = model.generate(**inputs, max_new_tokens=100)
    return {"response": tokenizer.decode(outputs[0], skip_special_tokens=True)}

⚙️ 3. AML Deployment YAML

$schema: https://azuremlschemas.azureedge.net/latest/managedOnlineDeployment.schema.json
name: apertus-deployment
endpoint_name: apertus-endpoint
model:
  path: .
environment:
  docker:
    image: azureml:custom-apertus:latest
  conda_file: environment.yml
instance_type: Standard_NC6
scale_settings:
  scale_type: automatic
  min_instances: 1
  max_instances: 3

🧪 4. Test via REST

curl -X POST https://<your-endpoint>.azurewebsites.net/generate \
-H "Content-Type: application/json" \
-d '{"inputs": "quelle solution de LLM êtes vous"}'

📚 Documentation officielle

Tu peux suivre le guide complet sur Microsoft Learn pour Hugging Face sur Azure ML ou consulter le guide de déploiement en un clic.



-----------------------------

Pierre Erol GIRAUDY

https://www.erolgiraudy.eu/

https://uga-ia.blogspot.com/

https://www.erolgiraudy.eu/2024/10/mes-15-livres.html

https://and500.blogspot.com/

https://www.ugaia.eu/

Pour Info : Mon livre https://amzn.eu/d/eTuHn56 sur AMAZON

Users Group Artificial Intelligence Andorra (U.G.A.I.A.) : Liste des Certificats PDF Microsoft Learn

Info SharePoint-Teams-Copilot

https://clubsp2013.blogspot.com/p/portfolio-microsoft-learn-pierre-erol.html



samedi 10 avril 2010

SharePoint Escalation Team : Installation And Configuration Of FAST Search Server for SharePoint 2010 (Beta)

This article describes how to install and configure Microsoft FAST Search Server 2010 for SharePoint as a multiple server deployment and also add the same as a back-end for Microsoft SharePoint Server 2010.We assume that SharePoint Server 2010 is already installed. Currently we will not focus on any installation steps of SharePoint 2010 server or SQL server 2008.

Note: FAST Search Server for SharePoint is recommended to be installed on a different server from Microsoft SharePoint Server.

Installation process:

FARM Snapshot once the configuration steps are followed

image

Plan your install
http://blogs.msdn.com/spses/archive/2010/04/09/installation-and-configuration-of-fast-search-server-for-sharepoint-2010-beta.aspx

Mots clés Technorati : ,,,,,

lundi 29 mars 2010

Article Visio et SharePoint 2010 l TechNet

LOGOSPS2010_noir

Merci au MVP VISIO 2010 (Article de Michel Laplane, MVP VISIO).

Création d’une configuration de test pour Visio Services

Le but de ce document est de décrire le processus de création d’un disque dur virtuel amorçable sous Windows 7 pour pouvoir mettre en place une configuration de test de Visio Services, la nouvelle fonctionnalité de Visio 2010 Professional ou Premium.

Article de Michel Laplane, MVP VISIO.

Site : http://www.groupemsvisio.fr

Article Visio et SharePoint 2010 l TechNet

CLUB SHAREPOINT FRANCE

EROLMVPMOSS Pierre_Erol_GIRAUDY_-_CLUB_SHAREPOINT_201031064723

mercredi 20 janvier 2010

Installing and configuring SharePoint 2010 - Download bonus book

This step by step guide shows how to install SharePoint 2010 on a virtual machine. Each step shows a screenshot that will help users to better understand the step. Host computer used during the preparation of this guide was a Vista (32-bit) machine (IBM 64-bit). Guest machine used was VMware workstation 7.0.

The guide lists hardware and software requirements. It has up-to-date links to download pre-requisite software. Pre-requisite software has to be installed in a particular order. Guide gives you tips on what to avoid during the installation. This is the most comprehensive compilation of SharePoint 2010 installation steps.

Installing and configuring SharePoint 2010 - Download bonus book

dimanche 20 décembre 2009

Installing SharePoint 2010 Beta on Windows 7 - SharePoint Grind

Tow points very differents, first this site is on-line with SPS2010 (Yes !) Second Windows 7 for SPS2010 (I do it, that is a great solution for tests).

Today I set out to install SharePoint Server 2010 on my local machine running Windows 7 Professional. This was one of the things I was most looking forward to about 2010, being able to develop locally is not only great for the developers out there, but also for us SharePoint Branding folks, i.e. web designers. It makes life SOOOOOO much easier when you don’t have to wrangle virtual machines in order to build out some master pages! So, needless to say, I was really looking forward to making this setup happen for myself.

So, there is an article you can follow on MSDN, which guides you through MOST of what you’ll need to do w/ the current beta that’s out there. However, when it comes to getting the configuration wizard to complete successfully, you’ll need to follow some extra steps, unsupported ones at that. Until the Hot fix comes out this is the only way you’ll get your installation up and running.

Installing SharePoint 2010 Beta on Windows 7 - SharePoint Grind

Pierre Erol GIRAUDY - MVP MOSS

Inscriptions aux TECHDAYS 2010

EROLMVPMOSSMINI MVP_RealWord

mercredi 4 novembre 2009

Préparation des environnements pour l’installation de SP 2010 , Blog de Fabrice

Dans le cadre de l’installation de SharePoint 2010, il a été précisé que cette nouvelle version du produit nécessitera un environnement totalement 64 Bits.

Ceci est totalement vrai, en effet, pour installer cette version vous aurez besoin de :

  • Windows 2008 Server (R1+SP2 ou R2) X64 pour les serveurs de la ferme SharePoint
  • SQL Server 2005 X64 ou SQL Server 2008 X64

SharePoint 2010 : Préparation des environnements pour l’installation de SP 2010 , Blog Technique de Romelard Fabrice

mardi 3 novembre 2009

Comment installer SHAREPOINT 2010

SharePoint 2010 – Install Steps

A great présention step-by-step !

As you are all aware the SharePoint 2010 NDA was lifted last week at the Microsoft SharePoint Conference 2009. So from now on there should be lots of posts about what 2010 can do and how it can be used. In this post I will walk you through the basic install, setting all the services and end up creating a base internet portal. As a note to start I am using the Tech Preview version of SharePoint 2010 which will look slightly different when it hits the public beta.

SharePoint 2010 – Install Steps

samedi 31 octobre 2009

Pour la réunion du 27 NOV à 14h45 chez MICROSOFT



Certains PPT vont changer en fonction du plan de la présentation du CLUB

Voir les vidéos de vulgarisation :
http://www.youtube.com/watch?v=M8fC6rLJFg0

Prévision (sujet à changement) pour notre réunion du 27 NOV du CLUB SHAREPOINT France (CSF) de 14h45 à 19h (4h) :

1. INTRO et situation du CLUB 15 minutes (GAT & EROL) + CLUB OUEST (Nicolas et Fabrice)
2. Karim MANARE va présenter de la SPC09
3. Patrick Guimonet nous fera une présentation générale de SP2010
4. Benoit HAMET aussi va nous faire une présentation SP2010
5. QUEST présenters la migration MOSS => SP2010 total (pause)

Avec les MVP
1. Dieudonné
2. Nicolas
3. Renaud
4. Fabrice BARBIBN
5. CONCLUSION et prochaine du CLUB 15 minutes (GAT & EROL + Fabrice + Nicolas)

Cocktail et échanges 18h30 à 19h
On pourra coupler un AFTERWORKS après la Réunion à 20h dans le XVe.

mercredi 21 octobre 2009

Single Server Complete Install of SharePoint 2010 using local accounts

The recommendation for a single server build of SharePoint 2010 is to use the Stand Alone installation giving you SQL express and a default configuration. But what if you want to use SQL Server 2008 and to have more control over the build, and to use local service accounts. In this case you need to use complete install and either PowerShell alone or a combination of Windows PowerShell and PSCONFIG(UI).EXE

Single Server Complete Install of SharePoint 2010 using local accounts - From The Field

lundi 28 septembre 2009

How to install SharePoint 2010 – Quick Video

How to install SharePoint 2010 – Quick Video

If you’re wanting to see how involved (or not) the installation of SharePoint 2010 is…check out this quick video. Obviously the more complex the deployment type, the more complex the installation type.

Click to view the brief walkthrough video (and yes I did edit it so it’s shorter)

I am running the latest SharePoint 2010 Beta Technical Preview…mileage is limited as the product release progresses…

Posted: Friday, September 25, 2009

shadowbox 2010 wave for developers : How to install SharePoint 2010 – Quick Video

mardi 15 septembre 2009

SharePoint First Contact With SharePoint 2010

SPS2010 

A priori, une liste de pré-requis assez importante avant l’installation!

    • Rôle IIS

    • Framework ‘Geneva’ (Détails ci-dessous tiré du site Connect Microsoft)

      • The “Geneva” Framework is a framework for building identity-aware applications.  The framework abstracts the WS-Trust and WS-Federation protocols and presents to developers APIs for building security token services and identity providers. Applications can externalize the authentication logic to security token services and focus on application specific logics that are based on claims available in the security tokens. Applications can use the framework to process tokens issued from security token services and make identity-based decisions at the web application or web service.

    • Microsoft Sync Framework Runtime 1.0

    • Chart Controls pour le framework 3.5

    • Microsoft Filter PAck 14 (IFilter) MS-Filter Pack

    • Client SQL Serveur 2008

    • Les API OCS 2007 R2 et Unified Communications Speech 2.0

    • Speech Server Language Pack V6.0

  • Une partie du File System de MOSS 2010

Voir le : Blog de Augusto Simoes | [SharePoint] First Contact With SharePoint 2010 (CodeName FourTeen)

Pierre Erol GIRAUDY - MVP MOSS

CLUB MOSS FRANCE - http://www.clubmoss2007.org/