1"use strict";(self.webpackChunkspring_ai_alibaba_website=self.webpackChunkspring_ai_alibaba_website||[]).push([[2566],{12975:(e,n,i)=>{i.r(n),i.d(n,{assets:()=>o,contentTitle:()=>c,default:()=>l,frontMatter:()=>s,metadata:()=>r,toc:()=>g});const r=JSON.parse('{"id":"chatmodels/more/huggingface","title":"Hugging Face Chat","description":"Hugging Face Text Generation Inference (TGI) \u662f\u4e00\u4e2a\u4e13\u95e8\u7528\u4e8e\u5728\u4e91\u7aef\u90e8\u7f72 Large Language Models (LLMs) \u7684\u89e3\u51b3\u65b9\u6848\uff0c\u901a\u8fc7 API \u4f7f\u5b83\u4eec\u53ef\u8bbf\u95ee\u3002TGI \u901a\u8fc7 continuous batching\u3001token streaming \u548c\u9ad8\u6548\u5185\u5b58\u7ba1\u7406\u7b49\u7279\u6027\uff0c\u4e3a\u6587\u672c\u751f\u6210\u4efb\u52a1\u63d0\u4f9b\u4f18\u5316\u7684\u6027\u80fd\u3002","source":"@site/integration/chatmodels/more/huggingface.md","sourceDirName":"chatmodels/more","slug":"/chatmodels/more/huggingface","permalink":"/integration/chatmodels/more/huggingface","draft":false,"unlisted":false,"editUrl":"https://github.com/spring-ai-alibaba/website/tree/main/integration/chatmodels/more/huggingface.md","tags":[],"version":"current","lastUpdatedBy":"txuw","lastUpdatedAt":1768049689000,"frontMatter":{},"sidebar":"integrationSidebar","previous":{"title":"Groq Chat","permalink":"/integration/chatmodels/more/groq-chat"},"next":{"title":"MiniMax Chat","permalink":"/integration/chatmodels/more/minimax-chat"}}');var a=i(74848),t=i(28453);const s={},c="Hugging Face Chat",o={},g=[{value:"Prerequisites",id:"prerequisites",level:2},{value:"Add Repositories and BOM",id:"add-repositories-and-bom",level:3},{value:"Auto-configuration",id:"auto-configuration",level:2},{value:"Chat Properties",id:"chat-properties",level:3},{value:"Sample Controller (Auto-configuration)",id:"sample-controller-auto-configuration",level:2},{value:"Manual Configuration",id:"manual-configuration",level:2}];function d(e){const n={a:"a",blockquote:"blockquote",code:"code",h1:"h1",h2:"h2",h3:"h3",header:"header",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,t.R)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.header,{children:(0,a.jsx)(n.h1,{id:"hugging-face-chat",children:"Hugging Face Chat"})}),"\n",(0,a.jsx)(n.p,{children:"Hugging Face Text Generation Inference (TGI) \u662f\u4e00\u4e2a\u4e13\u95e8\u7528\u4e8e\u5728\u4e91\u7aef\u90e8\u7f72 Large Language Models (LLMs) \u7684\u89e3\u51b3\u65b9\u6848\uff0c\u901a\u8fc7 API \u4f7f\u5b83\u4eec\u53ef\u8bbf\u95ee\u3002TGI \u901a\u8fc7 continuous batching\u3001token streaming \u548c\u9ad8\u6548\u5185\u5b58\u7ba1\u7406\u7b49\u7279\u6027\uff0c\u4e3a\u6587\u672c\u751f\u6210\u4efb\u52a1\u63d0\u4f9b\u4f18\u5316\u7684\u6027\u80fd\u3002"}),"\n",(0,a.jsxs)(n.blockquote,{children:["\n",(0,a.jsxs)(n.p,{children:[(0,a.jsx)(n.strong,{children:"\u91cd\u8981\uff1a"})," Text Generation Inference \u8981\u6c42\u6a21\u578b\u4e0e\u5176\u67b6\u6784\u7279\u5b9a\u7684\u4f18\u5316\u517c\u5bb9\u3002\u867d\u7136\u652f\u6301\u8bb8\u591a\u6d41\u884c\u7684 LLMs\uff0c\u4f46\u5e76\u975e Hugging Face Hub \u4e0a\u7684\u6240\u6709\u6a21\u578b\u90fd\u53ef\u4ee5\u4f7f\u7528 TGI \u90e8\u7f72\u3002\u5982\u679c\u60a8\u9700\u8981\u90e8\u7f72\u5176\u4ed6\u7c7b\u578b\u7684\u6a21\u578b\uff0c\u8bf7\u8003\u8651\u4f7f\u7528\u6807\u51c6\u7684 Hugging Face Inference Endpoints\u3002"]}),"\n"]}),"\n",(0,a.jsxs)(n.blockquote,{children:["\n",(0,a.jsxs)(n.p,{children:[(0,a.jsx)(n.strong,{children:"\u63d0\u793a\uff1a"})," \u6709\u5173\u652f\u6301\u7684\u6a21\u578b\u548c\u67b6\u6784\u7684\u5b8c\u6574\u548c\u6700\u65b0\u5217\u8868\uff0c\u8bf7\u53c2\u9605 ",(0,a.jsx)(n.a,{href:"https://huggingface.co/docs/text-generation-inference/en/supported_models",children:"Text Generation Inference supported models documentation"}),"\u3002"]}),"\n"]}),"\n",(0,a.jsx)(n.h2,{id:"prerequisites",children:"Prerequisites"}),"\n",(0,a.jsxs)(n.p,{children:["\u60a8\u9700\u8981\u5728 Hugging Face \u4e0a\u521b\u5efa\u4e00\u4e2a Inference Endpoint \u5e76\u521b\u5efa\u4e00\u4e2a API token \u6765\u8bbf\u95ee\u8be5\u7aef\u70b9\u3002\n\u66f4\u591a\u8be6\u7ec6\u4fe1\u606f\u53ef\u4ee5\u5728",(0,a.jsx)(n.a,{href:"https://huggingface.co/docs/inference-endpoints/index",children:"\u8fd9\u91cc"}),"\u627e\u5230\u3002"]}),"\n",(0,a.jsx)(n.p,{children:"Spring AI \u9879\u76ee\u5b9a\u4e49\u4e86\u4e24\u4e2a\u914d\u7f6e\u5c5e\u6027\uff1a"}),"\n",(0,a.jsxs)(n.ol,{children:["\n",(0,a.jsxs)(n.li,{children:[(0,a.jsx)(n.code,{children:"spring.ai.huggingface.chat.api-key"}),": \u5c06\u5176\u8bbe\u7f6e\u4e3a\u4ece Hugging Face \u83b7\u5f97\u7684 API token \u7684\u503c\u3002"]}),"\n",(0,a.jsxs)(n.li,{children:[(0,a.jsx)(n.code,{children:"spring.ai.huggingface.chat.url"}),": \u5c06\u5176\u8bbe\u7f6e\u4e3a\u5728 Hugging Face \u4e2d\u914d\u7f6e\u6a21\u578b\u65f6\u83b7\u5f97\u7684 inference endpoint URL\u3002"]}),"\n"]}),"\n",(0,a.jsxs)(n.p,{children:["\u60a8\u53ef\u4ee5\u5728 Inference Endpoint \u7684 UI ",(0,a.jsx)(n.a,{href:"https://ui.endpoints.huggingface.co/",children:"\u8fd9\u91cc"}),"\u627e\u5230\u60a8\u7684 inference endpoint URL\u3002"]}),"\n",(0,a.jsxs)(n.p,{children:["\u60a8\u53ef\u4ee5\u5728 ",(0,a.jsx)(n.code,{children:"application.properties"})," \u6587\u4ef6\u4e2d\u8bbe\u7f6e\u8fd9\u4e9b\u914d\u7f6e\u5c5e\u6027\uff1a"]}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-properties",children:"spring.ai.huggingface.chat.api-key=<your-huggingface-api-key>\nspring.ai.huggingface.chat.url=<your-inference-endpoint-url>\n"})}),"\n",(0,a.jsx)(n.p,{children:"\u4e3a\u4e86\u5728\u5904\u7406\u654f\u611f\u4fe1\u606f\uff08\u5982 API keys\uff09\u65f6\u589e\u5f3a\u5b89\u5168\u6027\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528 Spring Expression Language (SpEL) \u6765\u5f15\u7528\u81ea\u5b9a\u4e49\u73af\u5883\u53d8\u91cf\uff1a"}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-yaml",children:"# In application.yml\nspring:\n ai:\n huggingface:\n chat:\n api-key: ${HUGGINGFACE_API_KEY}\n url: ${HUGGINGFACE_ENDPOINT_URL}\n"})}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-bash",children:"# In your environment or .env file\nexport HUGGINGFACE_API_KEY=<your-huggingface-api-key>\nexport HUGGINGFACE_ENDPOINT_URL=<your-inference-endpoint-url>\n"})}),"\n",(0,a.jsx)(n.p,{children:"\u60a8\u4e5f\u53ef\u4ee5\u5728\u5e94\u7528\u7a0b\u5e8f\u4ee3\u7801\u4e2d\u4ee5\u7f16\u7a0b\u65b9\u5f0f\u8bbe\u7f6e\u8fd9\u4e9b\u914d\u7f6e\uff1a"}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-java",children:'// Retrieve API key and endpoint URL from secure sources or environment variables\nString apiKey = System.getenv("HUGGINGFACE_API_KEY");\nString endpointUrl = System.getenv("HUGGINGFACE_ENDPOINT_URL");\n'})}),"\n",(0,a.jsx)(n.h3,{id:"add-repositories-and-bom",children:"Add Repositories and BOM"}),"\n",(0,a.jsxs)(n.p,{children:["Spring AI artifacts \u53d1\u5e03\u5728 Maven Central \u548c Spring Snapshot \u4ed3\u5e93\u4e2d\u3002\n\u8bf7\u53c2\u9605 ",(0,a.jsx)(n.a,{href:"https://docs.spring.io/spring-ai/reference/getting-started.html#artifact-repositories",children:"Artifact Repositories"})," \u90e8\u5206\uff0c\u5c06\u8fd9\u4e9b\u4ed3\u5e93\u6dfb\u52a0\u5230\u60a8\u7684\u6784\u5efa\u7cfb\u7edf\u4e2d\u3002"]}),"\n",(0,a.jsxs)(n.p,{children:["\u4e3a\u4e86\u5e2e\u52a9\u8fdb\u884c\u4f9d\u8d56\u7ba1\u7406\uff0cSpring AI \u63d0\u4f9b\u4e86\u4e00\u4e2a BOM (bill of materials)\uff0c\u4ee5\u786e\u4fdd\u5728\u6574\u4e2a\u9879\u76ee\u4e2d\u4f7f\u7528\u4e00\u81f4\u7248\u672c\u7684 Spring AI\u3002\u8bf7\u53c2\u9605 ",(0,a.jsx)(n.a,{href:"https://docs.spring.io/spring-ai/reference/getting-started.html#dependency-management",children:"Dependency Management"})," \u90e8\u5206\uff0c\u5c06 Spring AI BOM \u6dfb\u52a0\u5230\u60a8\u7684\u6784\u5efa\u7cfb\u7edf\u4e2d\u3002"]}),"\n",(0,a.jsx)(n.h2,{id:"auto-configuration",children:"Auto-configuration"}),"\n",(0,a.jsxs)(n.blockquote,{children:["\n",(0,a.jsxs)(n.p,{children:[(0,a.jsx)(n.strong,{children:"\u6ce8\u610f\uff1a"}),"\nSpring AI auto-configuration\u3001starter modules \u7684 artifact \u540d\u79f0\u53d1\u751f\u4e86\u91cd\u5927\u53d8\u5316\u3002\n\u8bf7\u53c2\u9605 ",(0,a.jsx)(n.a,{href:"https://docs.spring.io/spring-ai/reference/upgrade-notes.html",children:"upgrade notes"})," \u4e86\u89e3\u66f4\u591a\u4fe1\u606f\u3002"]}),"\n"]}),"\n",(0,a.jsxs)(n.p,{children:["Spring AI \u4e3a Hugging Face Chat Client \u63d0\u4f9b Spring Boot auto-configuration\u3002\n\u8981\u542f\u7528\u5b83\uff0c\u8bf7\u5c06\u4ee5\u4e0b\u4f9d\u8d56\u9879\u6dfb\u52a0\u5230\u9879\u76ee\u7684 Maven ",(0,a.jsx)(n.code,{children:"pom.xml"})," \u6587\u4ef6\u4e2d\uff1a"]}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-xml",children:"<dependency>\n <groupId>org.springframework.ai</groupId>\n <artifactId>spring-ai-starter-model-huggingface</artifactId>\n</dependency>\n"})}),"\n",(0,a.jsxs)(n.p,{children:["\u6216\u6dfb\u52a0\u5230\u60a8\u7684 Gradle ",(0,a.jsx)(n.code,{children:"build.gradle"})," \u6784\u5efa\u6587\u4ef6\u4e2d\u3002"]}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-groovy",children:"dependencies {\n implementation 'org.springframework.ai:spring-ai-starter-model-huggingface'\n}\n"})}),"\n",(0,a.jsxs)(n.blockquote,{children:["\n",(0,a.jsxs)(n.p,{children:[(0,a.jsx)(n.strong,{children:"\u63d0\u793a\uff1a"})," \u8bf7\u53c2\u9605 ",(0,a.jsx)(n.a,{href:"https://docs.spring.io/spring-ai/reference/getting-started.html#dependency-management",children:"Dependency Management"})," \u90e8\u5206\uff0c\u5c06 Spring AI BOM \u6dfb\u52a0\u5230\u60a8\u7684\u6784\u5efa\u6587\u4ef6\u4e2d\u3002"]}),"\n"]}),"\n",(0,a.jsx)(n.h3,{id:"chat-properties",children:"Chat Properties"}),"\n",(0,a.jsxs)(n.blockquote,{children:["\n",(0,a.jsxs)(n.p,{children:[(0,a.jsx)(n.strong,{children:"\u6ce8\u610f\uff1a"}
1),"\n\u73b0\u5728\u901a\u8fc7\u524d\u7f00\u4e3a ",(0,a.jsx)(n.code,{children:"spring.ai.model.chat"})," \u7684\u9876\u7ea7\u5c5e\u6027\u6765\u914d\u7f6e chat auto-configurations \u7684\u542f\u7528\u548c\u7981\u7528\u3002"]}),"\n",(0,a.jsx)(n.p,{children:"\u8981\u542f\u7528\uff0cspring.ai.model.chat=huggingface\uff08\u9ed8\u8ba4\u542f\u7528\uff09"}),"\n",(0,a.jsx)(n.p,{children:"\u8981\u7981\u7528\uff0cspring.ai.model.chat=none\uff08\u6216\u4efb\u4f55\u4e0e huggingface \u4e0d\u5339\u914d\u7684\u503c\uff09"}),"\n",(0,a.jsx)(n.p,{children:"\u6b64\u66f4\u6539\u662f\u4e3a\u4e86\u5141\u8bb8\u914d\u7f6e\u591a\u4e2a\u6a21\u578b\u3002"}),"\n"]}),"\n",(0,a.jsxs)(n.p,{children:["\u524d\u7f00 ",(0,a.jsx)(n.code,{children:"spring.ai.huggingface"})," \u662f\u5141\u8bb8\u60a8\u4e3a Hugging Face \u914d\u7f6e chat model \u5b9e\u73b0\u7684\u5c5e\u6027\u524d\u7f00\u3002"]}),"\n",(0,a.jsxs)(n.table,{children:[(0,a.jsx)(n.thead,{children:(0,a.jsxs)(n.tr,{children:[(0,a.jsx)(n.th,{children:"Property"}),(0,a.jsx)(n.th,{children:"Description"}),(0,a.jsx)(n.th,{children:"Default"})]})}),(0,a.jsxs)(n.tbody,{children:[(0,a.jsxs)(n.tr,{children:[(0,a.jsx)(n.td,{children:"spring.ai.huggingface.chat.api-key"}),(0,a.jsx)(n.td,{children:"API Key \u7528\u4e8e\u4e0e Inference Endpoint \u8fdb\u884c\u8eab\u4efd\u9a8c\u8bc1\u3002"}),(0,a.jsx)(n.td,{children:"-"})]}),(0,a.jsxs)(n.tr,{children:[(0,a.jsx)(n.td,{children:"spring.ai.huggingface.chat.url"}),(0,a.jsx)(n.td,{children:"\u8981\u8fde\u63a5\u5230\u7684 Inference Endpoint \u7684 URL"}),(0,a.jsx)(n.td,{children:"-"})]}),(0,a.jsxs)(n.tr,{children:[(0,a.jsx)(n.td,{children:"spring.ai.huggingface.chat.enabled (Removed and no longer valid)"}),(0,a.jsx)(n.td,{children:"\u542f\u7528 Hugging Face chat model\u3002"}),(0,a.jsx)(n.td,{children:"true"})]}),(0,a.jsxs)(n.tr,{children:[(0,a.jsx)(n.td,{children:"spring.ai.model.chat"}),(0,a.jsx)(n.td,{children:"\u542f\u7528 Hugging Face chat model\u3002"}),(0,a.jsx)(n.td,{children:"huggingface"})]})]})]}),"\n",(0,a.jsx)(n.h2,{id:"sample-controller-auto-configuration",children:"Sample Controller (Auto-configuration)"}),"\n",(0,a.jsxs)(n.p,{children:[(0,a.jsx)(n.a,{href:"https://start.spring.io/",children:"Create"})," \u4e00\u4e2a\u65b0\u7684 Spring Boot \u9879\u76ee\uff0c\u5e76\u5c06 ",(0,a.jsx)(n.code,{children:"spring-ai-starter-model-huggingface"})," \u6dfb\u52a0\u5230\u60a8\u7684 pom\uff08\u6216 gradle\uff09\u4f9d\u8d56\u9879\u4e2d\u3002"]}),"\n",(0,a.jsxs)(n.p,{children:["\u5728 ",(0,a.jsx)(n.code,{children:"src/main/resources"})," \u76ee\u5f55\u4e0b\u6dfb\u52a0\u4e00\u4e2a ",(0,a.jsx)(n.code,{children:"application.properties"})," \u6587\u4ef6\uff0c\u4ee5\u542f\u7528\u548c\u914d\u7f6e Hugging Face chat model\uff1a"]}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-properties",children:"spring.ai.huggingface.chat.api-key=YOUR_API_KEY\nspring.ai.huggingface.chat.url=YOUR_INFERENCE_ENDPOINT_URL\n"})}),"\n",(0,a.jsxs)(n.blockquote,{children:["\n",(0,a.jsxs)(n.p,{children:[(0,a.jsx)(n.strong,{children:"\u63d0\u793a\uff1a"})," \u5c06 ",(0,a.jsx)(n.code,{children:"api-key"})," \u548c ",(0,a.jsx)(n.code,{children:"url"})," \u66ff\u6362\u4e3a\u60a8\u7684 Hugging Face \u503c\u3002"]}),"\n"]}),"\n",(0,a.jsxs)(n.p,{children:["\u8fd9\u5c06\u521b\u5efa\u4e00\u4e2a ",(0,a.jsx)(n.code,{children:"HuggingfaceChatModel"})," \u5b9e\u73b0\uff0c\u60a8\u53ef\u4ee5\u5c06\u5176\u6ce8\u5165\u5230\u60a8\u7684\u7c7b\u4e2d\u3002\n\u4ee5\u4e0b\u662f\u4e00\u4e2a\u7b80\u5355\u7684 ",(0,a.jsx)(n.code,{children:"@Controller"})," \u7c7b\u7684\u793a\u4f8b\uff0c\u5b83\u4f7f\u7528 chat model \u8fdb\u884c\u6587\u672c\u751f\u6210\u3002"]}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-java",children:'@RestController\npublic class ChatController {\n\n private final HuggingfaceChatModel chatModel;\n\n @Autowired\n public ChatController(HuggingfaceChatModel chatModel) {\n this.chatModel = chatModel;\n }\n\n @GetMapping("/ai/generate")\n public Map generate(@RequestParam(value = "message", defaultValue = "Tell me a joke") String message) {\n return Map.of("generation", this.chatModel.call(message));\n }\n}\n'})}),"\n",(0,a.jsx)(n.h2,{id:"manual-configuration",children:"Manual Configuration"}),"\n",(0,a.jsxs)(n.p,{children:[(0,a.jsx)(n.a,{href:"https://github.com/spring-projects/spring-ai/blob/main/models/spring-ai-
1huggingface/src/main/java/org/springframework/ai/huggingface/HuggingfaceChatModel.java",children:"HuggingfaceChatModel"})," \u5b9e\u73b0\u4e86 ",(0,a.jsx)(n.code,{children:"ChatModel"})," \u63a5\u53e3\uff0c\u5e76\u4f7f\u7528 \u3010low-level-api\u3011 \u8fde\u63a5\u5230 Hugging Face inference endpoints\u3002"]}),"\n",(0,a.jsxs)(n.p,{children:["\u5c06 ",(0,a.jsx)(n.code,{children:"spring-ai-huggingface"})," \u4f9d\u8d56\u9879\u6dfb\u52a0\u5230\u9879\u76ee\u7684 Maven ",(0,a.jsx)(n.code,{children:"pom.xml"})," \u6587\u4ef6\u4e2d\uff1a"]}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-xml",children:"<dependency>\n <groupId>org.springframework.ai</groupId>\n <artifactId>spring-ai-huggingface</artifactId>\n</dependency>\n"})}),"\n",(0,a.jsxs)(n.p,{children:["\u6216\u6dfb\u52a0\u5230\u60a8\u7684 Gradle ",(0,a.jsx)(n.code,{children:"build.gradle"})," \u6784\u5efa\u6587\u4ef6\u4e2d\u3002"]}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-groovy",children:"dependencies {\n implementation 'org.springframework.ai:spring-ai-huggingface'\n}\n"})}),"\n",(0,a.jsxs)(n.blockquote,{children:["\n",(0,a.jsxs)(n.p,{children:[(0,a.jsx)(n.strong,{children:"\u63d0\u793a\uff1a"})," \u8bf7\u53c2\u9605 ",(0,a.jsx)(n.a,{href:"https://docs.spring.io/spring-ai/reference/getting-started.html#dependency-management",children:"Dependency Management"})," \u90e8\u5206\uff0c\u5c06 Spring AI BOM \u6dfb\u52a0\u5230\u60a8\u7684\u6784\u5efa\u6587\u4ef6\u4e2d\u3002"]}),"\n"]}),"\n",(0,a.jsxs)(n.p,{children:["\u63a5\u4e0b\u6765\uff0c\u521b\u5efa\u4e00\u4e2a ",(0,a.jsx)(n.code,{children:"HuggingfaceChatModel"})," \u5e76\u5c06\u5176\u7528\u4e8e\u6587\u672c\u751f\u6210\uff1a"]}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-java",children:'HuggingfaceChatModel chatModel = new HuggingfaceChatModel(apiKey, url);\n\nChatResponse response = this.chatModel.call(\n new Prompt("Generate the names of 5 famous pirates."));\n\nSystem.out.println(response.getResult().getOutput().getText());\n'})})]})}function l(e={}){const{wrapper:n}={...(0,t.R)(),...e.components};return n?(0,a.jsx)(n,{...e,children:(0,a.jsx)(d,{...e})}):d(e)}},28453:(e,n,i)=>{i.d(n,{R:()=>s,x:()=>c});var r=i(96540);const a={},t=r.createContext(a);function s(e){const n=r.useContext(t);return r.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:s(e.components),r.createElement(t.Provider,{value:n},e.children)}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.