Buckets:

HuggingFaceDocBuilder's picture
download
raw
25.6 kB
<meta charset="utf-8" /><meta name="hf:doc:metadata" content="{&quot;title&quot;:&quot;Embarquement : vos premiers pas ⛵&quot;,&quot;local&quot;:&quot;embarquement--vos-premiers-pas-&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;Étape 1 : Créer votre compte Hugging Face&quot;,&quot;local&quot;:&quot;étape-1--créer-votre-compte-hugging-face&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;Étape 2 : Rejoindre notre Discord&quot;,&quot;local&quot;:&quot;étape-2--rejoindre-notre-discord&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;Étape 3 : Suivre l’organisation Hugging Face Agent Course sur le 🤗 Hub&quot;,&quot;local&quot;:&quot;étape-3--suivre-lorganisation-hugging-face-agent-course-sur-le--hub&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;Étape 4 : Faites passer le mot à propos du cours&quot;,&quot;local&quot;:&quot;étape-4--faites-passer-le-mot-à-propos-du-cours&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;Étape 5 : Exécuter des modèles localement avec Ollama (En cas de limites de crédits)&quot;,&quot;local&quot;:&quot;étape-5--exécuter-des-modèles-localement-avec-ollama-en-cas-de-limites-de-crédits&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3}],&quot;depth&quot;:1}">
<link href="/docs/agents-course/pr_673/fr/_app/immutable/assets/0.e3b0c442.css" rel="modulepreload">
<link rel="modulepreload" href="/docs/agents-course/pr_673/fr/_app/immutable/entry/start.6a3cabb6.js">
<link rel="modulepreload" href="/docs/agents-course/pr_673/fr/_app/immutable/chunks/scheduler.505acc25.js">
<link rel="modulepreload" href="/docs/agents-course/pr_673/fr/_app/immutable/chunks/singletons.f87ed60a.js">
<link rel="modulepreload" href="/docs/agents-course/pr_673/fr/_app/immutable/chunks/index.001f95d5.js">
<link rel="modulepreload" href="/docs/agents-course/pr_673/fr/_app/immutable/chunks/paths.cc8cef00.js">
<link rel="modulepreload" href="/docs/agents-course/pr_673/fr/_app/immutable/entry/app.bbc296eb.js">
<link rel="modulepreload" href="/docs/agents-course/pr_673/fr/_app/immutable/chunks/preload-helper.f888915a.js">
<link rel="modulepreload" href="/docs/agents-course/pr_673/fr/_app/immutable/chunks/index.b1175496.js">
<link rel="modulepreload" href="/docs/agents-course/pr_673/fr/_app/immutable/nodes/0.8f31a791.js">
<link rel="modulepreload" href="/docs/agents-course/pr_673/fr/_app/immutable/chunks/each.e59479a4.js">
<link rel="modulepreload" href="/docs/agents-course/pr_673/fr/_app/immutable/nodes/19.7944a079.js">
<link rel="modulepreload" href="/docs/agents-course/pr_673/fr/_app/immutable/chunks/Heading.aedc5b40.js">
<link rel="modulepreload" href="/docs/agents-course/pr_673/fr/_app/immutable/chunks/MermaidChart.svelte_svelte_type_style_lang.11cb69c9.js">
<link rel="modulepreload" href="/docs/agents-course/pr_673/fr/_app/immutable/chunks/CodeBlock.91f006af.js"><!-- HEAD_svelte-u9bgzb_START --><meta name="hf:doc:metadata" content="{&quot;title&quot;:&quot;Embarquement : vos premiers pas ⛵&quot;,&quot;local&quot;:&quot;embarquement--vos-premiers-pas-&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;Étape 1 : Créer votre compte Hugging Face&quot;,&quot;local&quot;:&quot;étape-1--créer-votre-compte-hugging-face&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;Étape 2 : Rejoindre notre Discord&quot;,&quot;local&quot;:&quot;étape-2--rejoindre-notre-discord&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;Étape 3 : Suivre l’organisation Hugging Face Agent Course sur le 🤗 Hub&quot;,&quot;local&quot;:&quot;étape-3--suivre-lorganisation-hugging-face-agent-course-sur-le--hub&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;Étape 4 : Faites passer le mot à propos du cours&quot;,&quot;local&quot;:&quot;étape-4--faites-passer-le-mot-à-propos-du-cours&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;Étape 5 : Exécuter des modèles localement avec Ollama (En cas de limites de crédits)&quot;,&quot;local&quot;:&quot;étape-5--exécuter-des-modèles-localement-avec-ollama-en-cas-de-limites-de-crédits&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3}],&quot;depth&quot;:1}"><!-- HEAD_svelte-u9bgzb_END --> <p></p> <div class="items-center shrink-0 min-w-[100px] max-sm:min-w-[50px] justify-end ml-auto flex" style="float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"><div class="inline-flex rounded-md max-sm:rounded-sm"><button class="inline-flex items-center gap-1 h-7 max-sm:h-7 px-2 max-sm:px-1.5 text-sm font-medium text-gray-800 border border-r-0 rounded-l-md max-sm:rounded-l-sm border-gray-200 bg-white hover:shadow-inner dark:border-gray-850 dark:bg-gray-950 dark:text-gray-200 dark:hover:bg-gray-800" aria-live="polite"><span class="inline-flex items-center justify-center rounded-md p-0.5 max-sm:p-0 hover:text-gray-800 dark:hover:text-gray-200"><svg class="sm:size-3.5 size-3" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg></span> <span>Copy page</span></button> <button class="inline-flex items-center justify-center w-6 max-sm:w-5 h-7 max-sm:h-7 disabled:pointer-events-none text-sm text-gray-500 hover:text-gray-700 dark:hover:text-white rounded-r-md max-sm:rounded-r-sm border border-l transition border-gray-200 bg-white hover:shadow-inner dark:border-gray-850 dark:bg-gray-950 dark:text-gray-200 dark:hover:bg-gray-800" aria-haspopup="menu" aria-expanded="false" aria-label="Open copy menu"><svg class="transition-transform text-gray-400 overflow-visible sm:size-3.5 size-3 rotate-0" width="1em" height="1em" viewBox="0 0 12 7" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M1 1L6 6L11 1" stroke="currentColor"></path></svg></button></div> </div> <h1 class="relative group"><a id="embarquement--vos-premiers-pas-" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#embarquement--vos-premiers-pas-"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Embarquement : vos premiers pas ⛵</span></h1> <img src="https://huggingface.co/datasets/agents-course/course-images/resolve/main/en/unit0/time-to-onboard.jpg" alt="Il est temps de démarrer" width="100%"> <p data-svelte-h="svelte-4w83xl">Maintenant que vous avez tous les détails, commençons ! Nous allons réaliser quatre choses :</p> <ol data-svelte-h="svelte-139om0u"><li><strong>Créer votre compte Hugging Face</strong> si ce n’est pas déjà fait</li> <li><strong>Vous inscrire à Discord et vous présenter</strong> (ne soyez pas timide 🤗)</li> <li><strong>Suivre le cours sur les agents</strong> sur le 🤗 Hub</li> <li><strong>Faire passer le mot</strong> à propos du cours</li></ol> <h3 class="relative group"><a id="étape-1--créer-votre-compte-hugging-face" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#étape-1--créer-votre-compte-hugging-face"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Étape 1 : Créer votre compte Hugging Face</span></h3> <p data-svelte-h="svelte-19yn0d4">(Si ce n’est pas déjà fait) créez un compte Hugging Face <a href="https://huggingface.co/join" target="_blank">ici</a>.</p> <h3 class="relative group"><a id="étape-2--rejoindre-notre-discord" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#étape-2--rejoindre-notre-discord"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Étape 2 : Rejoindre notre Discord</span></h3> <p data-svelte-h="svelte-p05t66">👉🏻 Rejoignez notre serveur Discord <a href="https://discord.gg/UrrTSsSyjb" target="_blank">ici.</a></p> <p data-svelte-h="svelte-uqg34l">Lorsque vous rejoignez, n’oubliez pas de vous présenter dans <code>#introduce-yourself</code>.</p> <p data-svelte-h="svelte-1is706c">Consultez le canal <code>courses</code> sur le <code>Hugging Face Hub</code> pour toutes les questions et demandes liées aux cours.</p> <p data-svelte-h="svelte-1s911p7">Si c’est votre première utilisation de Discord, nous avons rédigé un guide d’introduction pour vous donner les meilleures pratiques. Consultez <a href="discord101">la section suivante</a>.</p> <h3 class="relative group"><a id="étape-3--suivre-lorganisation-hugging-face-agent-course-sur-le--hub" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#étape-3--suivre-lorganisation-hugging-face-agent-course-sur-le--hub"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Étape 3 : Suivre l’organisation Hugging Face Agent Course sur le 🤗 Hub</span></h3> <p data-svelte-h="svelte-81031c">Restez à jour avec les derniers matériels de cours, mises à jour, et annonces <strong>en suivant l’organisation du cours sur le Hub</strong>.</p> <p data-svelte-h="svelte-j74mlc">👉 Rendez-vous <a href="https://huggingface.co/agents-course" target="_blank">ici</a> et cliquez sur <strong>suivre</strong>.</p> <img src="https://huggingface.co/datasets/agents-course/course-images/resolve/main/en/communication/hf_course_follow.gif" alt="Suivre" width="100%"> <h3 class="relative group"><a id="étape-4--faites-passer-le-mot-à-propos-du-cours" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#étape-4--faites-passer-le-mot-à-propos-du-cours"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Étape 4 : Faites passer le mot à propos du cours</span></h3> <p data-svelte-h="svelte-ekprv2">Aidez-nous à rendre ce cours plus visible ! Il y a deux façons de nous aider :</p> <ol data-svelte-h="svelte-153zhb3"><li>Montrez votre soutien en <a href="https://github.com/huggingface/agents-course" target="_blank">laissant une étoile ⭐ sur le dépôt du cours</a>.</li></ol> <img src="https://huggingface.co/datasets/agents-course/course-images/resolve/main/en/communication/please_star.gif" alt="Favoriser le dépôt"> <ol start="2" data-svelte-h="svelte-1lfp1n"><li>Partagez votre parcours d’apprentissage : faites savoir aux autres <strong>que vous suivez ce cours</strong> ! Nous avons préparé une illustration que vous pouvez utiliser dans vos publications sur les réseaux sociaux.</li></ol> <img src="https://huggingface.co/datasets/agents-course/course-images/resolve/main/en/communication/share.png" alt="Partagez votre parcours d'apprentissage" width="100%"> <p data-svelte-h="svelte-1vjej1y">Vous pouvez télécharger l’image en cliquant 👉 <a href="https://huggingface.co/datasets/agents-course/course-images/resolve/main/en/communication/share.png?download=true" rel="nofollow">ici</a></p> <h3 class="relative group"><a id="étape-5--exécuter-des-modèles-localement-avec-ollama-en-cas-de-limites-de-crédits" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#étape-5--exécuter-des-modèles-localement-avec-ollama-en-cas-de-limites-de-crédits"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Étape 5 : Exécuter des modèles localement avec Ollama (En cas de limites de crédits)</span></h3> <ol data-svelte-h="svelte-1tcusv7"><li><p><strong>Installez Ollama</strong></p> <p>Suivez les instructions officielles <a href="https://ollama.com/download" target="_blank">ici.</a></p></li> <li><p><strong>Téléchargez un modèle localement</strong></p></li></ol> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START --> ollama pull qwen2:7b <span class="hljs-comment"># Consultez le site web d&#x27;Ollama pour plus de modèles</span><!-- HTML_TAG_END --></pre></div> <ol start="3" data-svelte-h="svelte-86sggu"><li><strong>Démarrez Ollama en arrière-plan (dans un terminal)</strong></li></ol> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START --> ollama serve<!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-1n67j1v">Si vous rencontrez l’erreur ”<em>listen tcp 127.0.0.1:11434: bind: address already in use</em>”, vous pouvez utiliser la commande <code>sudo lsof -i :11434</code> pour identifier l’ID du processus (PID) qui utilise actuellement ce port. Si le processus est <code>ollama</code>, il est probable que le script d’installation ci-dessus ait démarré le service ollama, vous pouvez donc ignorer cette commande pour démarrer Ollama.</p> <ol start="4" data-svelte-h="svelte-mbdiqh"><li><p><strong>Utilisez <code>LiteLLMModel</code> au lieu de <code>InferenceClientModel</code></strong></p> <p>Pour utiliser le module <code>LiteLLMModel</code> dans <code>smolagents</code>, vous pouvez exécuter la commande <code>pip</code> pour installer le module.</p></li></ol> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START --> pip install <span class="hljs-string">&#x27;smolagents[litellm]&#x27;</span><!-- HTML_TAG_END --></pre></div> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START --> <span class="hljs-keyword">from</span> smolagents <span class="hljs-keyword">import</span> LiteLLMModel
model = LiteLLMModel(
model_id=<span class="hljs-string">&quot;ollama_chat/qwen2:7b&quot;</span>, <span class="hljs-comment"># Ou essayez d&#x27;autres modèles supportés par Ollama</span>
api_base=<span class="hljs-string">&quot;http://127.0.0.1:11434&quot;</span>, <span class="hljs-comment"># Serveur local Ollama par défaut</span>
num_ctx=<span class="hljs-number">8192</span>,
)<!-- HTML_TAG_END --></pre></div> <ol start="5" data-svelte-h="svelte-1xn6qbw"><li><strong>Pourquoi cela fonctionne-t-il ?</strong></li></ol> <ul data-svelte-h="svelte-8vmg6r"><li>Ollama sert des modèles localement en utilisant une API compatible avec OpenAI à <code>http://localhost:11434</code>.</li> <li><code>LiteLLMModel</code> est conçu pour communiquer avec tout modèle qui supporte le format d’API OpenAI chat/completion.</li> <li>Cela signifie que vous pouvez simplement remplacer <code>InferenceClientModel</code> par <code>LiteLLMModel</code> sans autres changements de code nécessaires. C’est une solution transparente et prête à l’emploi.</li></ul> <p data-svelte-h="svelte-v3j5v3">Félicitations ! 🎉<br> <strong>Vous avez terminé le processus d’embarquement</strong> ! Vous êtes maintenant prêt à commencer à en apprendre plus sur les agents IA. Amusez-vous bien !</p> <p data-svelte-h="svelte-1m1mvq7">Continuez à apprendre, restez formidable 🤗</p> <a class="!text-gray-400 !no-underline text-sm flex items-center not-prose mt-4" href="https://github.com/huggingface/agents-course/blob/main/units/fr/unit0/onboarding.mdx" target="_blank"><svg class="mr-1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M31,16l-7,7l-1.41-1.41L28.17,16l-5.58-5.59L24,9l7,7z"></path><path d="M1,16l7-7l1.41,1.41L3.83,16l5.58,5.59L8,23l-7-7z"></path><path d="M12.419,25.484L17.639,6.552l1.932,0.518L14.351,26.002z"></path></svg> <span data-svelte-h="svelte-zjs2n5"><span class="underline">Update</span> on GitHub</span></a> <p></p>
<script>
{
__sveltekit_1b31nyx = {
assets: "/docs/agents-course/pr_673/fr",
base: "/docs/agents-course/pr_673/fr",
env: {}
};
const element = document.currentScript.parentElement;
const data = [null,null];
Promise.all([
import("/docs/agents-course/pr_673/fr/_app/immutable/entry/start.6a3cabb6.js"),
import("/docs/agents-course/pr_673/fr/_app/immutable/entry/app.bbc296eb.js")
]).then(([kit, app]) => {
kit.start(app, element, {
node_ids: [0, 19],
data,
form: null,
error: null
});
});
}
</script>

Xet Storage Details

Size:
25.6 kB
·
Xet hash:
9f3c5753f5d2201f786b1ccf88a1fbd2e488885f0f665de78276c45364c5a34b

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.