import{s as _t,n as xt,o as Mt}from"../chunks/scheduler.505acc25.js";import{S as ht,i as Ht,e as r,s as i,c as X,h as Ct,a as o,d as n,b as s,f as ct,g as Y,j as p,k as Tt,l as bt,m as l,n as Z,t as tt,o as et,p as nt}from"../chunks/index.b1175496.js";import{C as Pt,H as vt}from"../chunks/Heading.eda51538.js";import{E as dt}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.ea377ea6.js";function wt(lt){let a,w,P,y,u,A,m,k,f,it='<img src="https://huggingface.co/datasets/agents-course/course-images/resolve/main/en/bonus-unit1/thumbnail.jpg" alt="附加单元1缩略图"/>',E,g,st="欢迎来到第一个<strong>附加单元</strong>，在这里你将学习如何<strong>为函数调用 (function calling) 微调大语言模型 (Large Language Model, LLM)</strong>。",R,L,rt="在大语言模型领域，函数调用正在迅速成为一项<em>必须掌握</em>的技术。",z,$,ot="这个想法是，不同于我们在第1单元中仅依赖基于提示的方法，函数调用在训练阶段就训练你的模型<strong>采取行动和解释观察结果</strong>，使你的人工智能更加健壮。",O,c,pt="<p><strong>我应该什么时候学习这个附加单元？</strong></p> <p>这个部分是<strong>可选的</strong>，比第1单元更高级，所以不要犹豫，你可以现在就学习这个单元，或者在通过本课程提高了知识水平后再回来学习。</p> <p>但不用担心，这个附加单元设计时包含了你需要的所有信息，所以即使你还没有学习微调的内部工作原理，我们也会带你了解为函数调用微调模型的每个核心概念。</p>",S,T,at="让你能够跟上这个附加单元的最佳方式是：",j,v,ut='<li><p>了解如何使用 Transformers 微调大语言模型，如果你还不了解，<a href="https://huggingface.co/learn/nlp-course/chapter3/1?fw=pt" rel="nofollow">请查看这里</a></p></li> <li><p>了解如何使用 <code>SFTTrainer</code> 来微调我们的模型，要了解更多信息，<a href="https://huggingface.co/learn/nlp-course/en/chapter11/1" rel="nofollow">请查看这份文档</a></p></li>',q,I,U,_,F,x,mt=`<li><p><strong>函数调用 (Function Calling)</strong><br/>
现代大语言模型如何有效地构建对话，使它们能够触发<strong>工具 (Tools)</strong>。</p></li> <li><p><strong>LoRA（低秩适应，Low-Rank Adaptation）</strong><br/>
一种<strong>轻量级且高效</strong>的微调方法，减少计算和存储开销。LoRA 使大型模型的训练变得<em>更快、更便宜、更容易</em>部署。</p></li> <li><p><strong>函数调用模型中的思考 → 行动 → 观察循环(Thought → Act → Observe Cycle)</strong><br/>
一种简单但强大的方法，用于构建模型如何决定何时（以及如何）调用函数、跟踪中间步骤以及解释来自外部工具或API的结果。</p></li> <li><p><strong>新的特殊词元 (Special Tokens)</strong><br/>
我们将介绍<strong>特殊标记</strong>，帮助模型区分：</p> <ul><li>内部”思维链”推理</li> <li>外部函数调用</li> <li>来自外部工具的响应</li></ul></li>`,B,G,K,M,ft="在完成这个附加单元后，你将能够：",N,h,gt="<li><strong>理解</strong>工具相关的 API 内部工作原理。</li> <li>使用 LoRA 技术<strong>微调</strong>模型。</li> <li><strong>实现</strong>和<strong>修改</strong>思考 → 行动 → 观察循环，以创建健壮和可维护的函数调用工作流。</li> <li><strong>设计和使用</strong>特殊词元，无缝分离模型的内部推理和外部行动。</li>",Q,H,Lt="而且你将<strong>拥有自己微调的模型来进行函数调用。</strong> 🔥",D,C,$t="让我们深入了解<strong>函数调用</strong>吧！",J,b,V,d,W;return u=new Pt({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),m=new vt({props:{title:"简介 (Introduction)",local:"简介-introduction",headingTag:"h1"}}),_=new vt({props:{title:"你将学到什么",local:"你将学到什么",headingTag:"h2"}}),b=new dt({props:{source:"https://github.com/huggingface/agents-course/blob/main/units/zh-CN/bonus-unit1/introduction.mdx"}}),{c(){a=r("meta"),w=i(),P=r("p"),y=i(),X(u.$$.fragment),A=i(),X(m.$$.fragment),k=i(),f=r("p"),f.innerHTML=it,E=i(),g=r("p"),g.innerHTML=st,R=i(),L=r("p"),L.innerHTML=rt,z=i(),$=r("p"),$.innerHTML=ot,O=i(),c=r("blockquote"),c.innerHTML=pt,S=i(),T=r("p"),T.textContent=at,j=i(),v=r("ol"),v.innerHTML=ut,q=i(),I=r("hr"),U=i(),X(_.$$.fragment),F=i(),x=r("ol"),x.innerHTML=mt,B=i(),G=r("hr"),K=i(),M=r("p"),M.textContent=ft,N=i(),h=r("ul"),h.innerHTML=gt,Q=i(),H=r("p"),H.innerHTML=Lt,D=i(),C=r("p"),C.innerHTML=$t,J=i(),X(b.$$.fragment),V=i(),d=r("p"),this.h()},l(t){const e=Ct("svelte-u9bgzb",document.head);a=o(e,"META",{name:!0,content:!0}),e.forEach(n),w=s(t),P=o(t,"P",{}),ct(P).forEach(n),y=s(t),Y(u.$$.fragment,t),A=s(t),Y(m.$$.fragment,t),k=s(t),f=o(t,"P",{"data-svelte-h":!0}),p(f)!=="svelte-eemj1f"&&(f.innerHTML=it),E=s(t),g=o(t,"P",{"data-svelte-h":!0}),p(g)!=="svelte-1wgkx6z"&&(g.innerHTML=st),R=s(t),L=o(t,"P",{"data-svelte-h":!0}),p(L)!=="svelte-1ez96r4"&&(L.innerHTML=rt),z=s(t),$=o(t,"P",{"data-svelte-h":!0}),p($)!=="svelte-1lt4bwf"&&($.innerHTML=ot),O=s(t),c=o(t,"BLOCKQUOTE",{"data-svelte-h":!0}),p(c)!=="svelte-1fds36h"&&(c.innerHTML=pt),S=s(t),T=o(t,"P",{"data-svelte-h":!0}),p(T)!=="svelte-14192pp"&&(T.textContent=at),j=s(t),v=o(t,"OL",{"data-svelte-h":!0}),p(v)!=="svelte-1hzjwim"&&(v.innerHTML=ut),q=s(t),I=o(t,"HR",{}),U=s(t),Y(_.$$.fragment,t),F=s(t),x=o(t,"OL",{"data-svelte-h":!0}),p(x)!=="svelte-16eie1l"&&(x.innerHTML=mt),B=s(t),G=o(t,"HR",{}),K=s(t),M=o(t,"P",{"data-svelte-h":!0}),p(M)!=="svelte-1gdrjf1"&&(M.textContent=ft),N=s(t),h=o(t,"UL",{"data-svelte-h":!0}),p(h)!=="svelte-o3qlna"&&(h.innerHTML=gt),Q=s(t),H=o(t,"P",{"data-svelte-h":!0}),p(H)!=="svelte-ec9y99"&&(H.innerHTML=Lt),D=s(t),C=o(t,"P",{"data-svelte-h":!0}),p(C)!=="svelte-1lkd5hm"&&(C.innerHTML=$t),J=s(t),Y(b.$$.fragment,t),V=s(t),d=o(t,"P",{}),ct(d).forEach(n),this.h()},h(){Tt(a,"name","hf:doc:metadata"),Tt(a,"content",yt)},m(t,e){bt(document.head,a),l(t,w,e),l(t,P,e),l(t,y,e),Z(u,t,e),l(t,A,e),Z(m,t,e),l(t,k,e),l(t,f,e),l(t,E,e),l(t,g,e),l(t,R,e),l(t,L,e),l(t,z,e),l(t,$,e),l(t,O,e),l(t,c,e),l(t,S,e),l(t,T,e),l(t,j,e),l(t,v,e),l(t,q,e),l(t,I,e),l(t,U,e),Z(_,t,e),l(t,F,e),l(t,x,e),l(t,B,e),l(t,G,e),l(t,K,e),l(t,M,e),l(t,N,e),l(t,h,e),l(t,Q,e),l(t,H,e),l(t,D,e),l(t,C,e),l(t,J,e),Z(b,t,e),l(t,V,e),l(t,d,e),W=!0},p:xt,i(t){W||(tt(u.$$.fragment,t),tt(m.$$.fragment,t),tt(_.$$.fragment,t),tt(b.$$.fragment,t),W=!0)},o(t){et(u.$$.fragment,t),et(m.$$.fragment,t),et(_.$$.fragment,t),et(b.$$.fragment,t),W=!1},d(t){t&&(n(w),n(P),n(y),n(A),n(k),n(f),n(E),n(g),n(R),n(L),n(z),n($),n(O),n(c),n(S),n(T),n(j),n(v),n(q),n(I),n(U),n(F),n(x),n(B),n(G),n(K),n(M),n(N),n(h),n(Q),n(H),n(D),n(C),n(J),n(V),n(d)),n(a),nt(u,t),nt(m,t),nt(_,t),nt(b,t)}}}const yt='{"title":"简介 (Introduction)","local":"简介-introduction","sections":[{"title":"你将学到什么","local":"你将学到什么","sections":[],"depth":2}],"depth":1}';function At(lt){return Mt(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ot extends ht{constructor(a){super(),Ht(this,a,At,wt,_t,{})}}export{Ot as component};
