{"id":18502,"date":"2025-04-19T00:53:16","date_gmt":"2025-04-18T16:53:16","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/18502.html"},"modified":"2025-04-19T00:53:16","modified_gmt":"2025-04-18T16:53:16","slug":"%e6%9c%8d%e5%8a%a1%e5%99%a8%e6%97%a0%e6%b3%95%e8%bf%9e%e6%8e%a5huggingface%e4%b8%8b%e8%bd%bd%e6%a8%a1%e5%9e%8b","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/18502.html","title":{"rendered":"\u670d\u52a1\u5668\u65e0\u6cd5\u8fde\u63a5huggingface\u4e0b\u8f7d\u6a21\u578b"},"content":{"rendered":"<h3>\u62a5\u9519\u4ee3\u7801<\/h3>\n<p><span class=\"token keyword\">import<\/span> torch<br \/>\n<span class=\"token keyword\">from<\/span> FlagEmbedding<span class=\"token punctuation\">.<\/span>visual<span class=\"token punctuation\">.<\/span>modeling <span class=\"token keyword\">import<\/span> Visualized_BGE<\/p>\n<p><span class=\"token keyword\">def<\/span> <span class=\"token function\">image_retrival<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    <span class=\"token comment\">############ Use Visualized BGE doing composed image retrieval<\/span><br \/>\n    model <span class=\"token operator\">&#061;<\/span> Visualized_BGE<span class=\"token punctuation\">(<\/span>model_name_bge <span class=\"token operator\">&#061;<\/span> <span class=\"token string\">&#034;BAAI\/bge-m3&#034;<\/span><span class=\"token punctuation\">,<\/span> model_weight<span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;\/data\/suanfa\/meng\/mybge-m3\/Visualized_m3.pth&#034;<\/span><span class=\"token punctuation\">)<\/span><br \/>\n    model<span class=\"token punctuation\">.<\/span><span class=\"token builtin\">eval<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><br \/>\n    <span class=\"token keyword\">with<\/span> torch<span class=\"token punctuation\">.<\/span>no_grad<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">:<\/span><br \/>\n        query_emb <span class=\"token operator\">&#061;<\/span> model<span class=\"token punctuation\">.<\/span>encode<span class=\"token punctuation\">(<\/span>image<span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;..\/image\/whitedogwithyellowleaf.jpg\/&#034;<\/span><span class=\"token punctuation\">,<\/span> text<span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;Make the background dark, as if the camera has taken the photo at night&#034;<\/span><span class=\"token punctuation\">)<\/span><br \/>\n        candi_emb_1 <span class=\"token operator\">&#061;<\/span> model<span class=\"token punctuation\">.<\/span>encode<span class=\"token punctuation\">(<\/span>image<span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;..\/image\/4dogs_on_lawn.jpg&#034;<\/span><span class=\"token punctuation\">)<\/span><br \/>\n        candi_emb_2 <span class=\"token operator\">&#061;<\/span> model<span class=\"token punctuation\">.<\/span>encode<span class=\"token punctuation\">(<\/span>image<span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;..\/image\/whitedog.jpg&#034;<\/span><span class=\"token punctuation\">)<\/span><\/p>\n<p>    sim_1 <span class=\"token operator\">&#061;<\/span> query_emb &#064; candi_emb_1<span class=\"token punctuation\">.<\/span>T<br \/>\n    sim_2 <span class=\"token operator\">&#061;<\/span> query_emb &#064; candi_emb_2<span class=\"token punctuation\">.<\/span>T<br \/>\n    <span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span>sim_1<span class=\"token punctuation\">,<\/span> sim_2<span class=\"token punctuation\">)<\/span><br \/>\n<span class=\"token keyword\">if<\/span> __name__<span class=\"token operator\">&#061;&#061;<\/span><span class=\"token string\">&#039;__main__&#039;<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    image_retrival<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><\/p>\n<h3>\u62a5\u9519<\/h3>\n<p>OSError<span class=\"token punctuation\">:<\/span> We couldn<span class=\"token string\">&#039;t connect to &#039;<\/span>https<span class=\"token punctuation\">:<\/span><span class=\"token operator\">\/\/<\/span>huggingface<span class=\"token punctuation\">.<\/span>co<span class=\"token string\">&#039; to load this file, couldn&#039;<\/span>t find it <span class=\"token keyword\">in<\/span> the cached files <span class=\"token keyword\">and<\/span> it looks like BAAI<span class=\"token operator\">\/<\/span>bge<span class=\"token operator\">&#8211;<\/span>m3 <span class=\"token keyword\">is<\/span> <span class=\"token keyword\">not<\/span> the path to a directory containing a <span class=\"token builtin\">file<\/span> named config<span class=\"token punctuation\">.<\/span>json<span class=\"token punctuation\">.<\/span><br \/>\nCheckout your internet connection <span class=\"token keyword\">or<\/span> see how to run the library <span class=\"token keyword\">in<\/span> offline mode at <span class=\"token string\">&#039;https:\/\/huggingface.co\/docs\/transformers\/installation#offline-model&#039;<\/span><span class=\"token punctuation\">.<\/span><\/p>\n<h3>\u89e3\u51b3\u65b9\u6cd51&#xff1a;offline-mode\u5f62\u5f0f<\/h3>\n<p>1.\u6253\u5f00hugging face \u5b98\u7f51&#xff1a;https:\/\/huggingface.co\/docs\/transformers\/installation#offline-mode \u5e76\u70b9\u51fbModels <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418165314-6802837a6d989.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/> 2.\u641c\u7d22\u6211\u4eec\u9700\u8981\u7684\u6a21\u578b <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418165314-6802837abd0f3.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/> \u8f93\u5165\u4f7f\u7528\u7684\u6a21\u578b&#xff0c;\u5e76\u70b9\u51fb\u6a21\u578b 3.\u4e0b\u8f7d\u6587\u4ef6 <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418165315-6802837b28548.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/> \u70b9\u51fbfile and versions \u901a\u8fc7\u540e\u9762\u7684\u4e0b\u8f7d\u6309\u94ae\u4e0b\u8f7d\u5708\u51fa\u7684\u4e94\u4e2a\u6587\u4ef6\u5230\u672c\u5730 4.\u4e0a\u4f20\u6587\u4ef6\u5230\u670d\u52a1\u5668<\/p>\n<p><span class=\"token punctuation\">(<\/span>py38_bge<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">[<\/span>root&#064;x<span class=\"token punctuation\">.<\/span>x<span class=\"token punctuation\">.<\/span>x<span class=\"token punctuation\">.<\/span>x <span class=\"token operator\">\/<\/span>data<span class=\"token operator\">\/<\/span>suanfa<span class=\"token operator\">\/<\/span>meng<span class=\"token operator\">\/<\/span>mybge<span class=\"token operator\">&#8211;<\/span>m3<span class=\"token operator\">\/<\/span>bge<span class=\"token operator\">&#8211;<\/span>m3<span class=\"token punctuation\">]<\/span>$ ll<br \/>\ntotal <span class=\"token number\">21664<\/span><br \/>\n<span class=\"token operator\">&#8211;<\/span>rw<span class=\"token operator\">&#8211;<\/span>r<span class=\"token operator\">&#8211;<\/span><span class=\"token operator\">&#8211;<\/span>r<span class=\"token operator\">&#8211;<\/span><span class=\"token operator\">&#8211;<\/span> <span class=\"token number\">1<\/span> root root      <span class=\"token number\">687<\/span> Oct  <span class=\"token number\">9<\/span> <span class=\"token number\">20<\/span><span class=\"token punctuation\">:<\/span><span class=\"token number\">01<\/span> config<span class=\"token punctuation\">.<\/span>json<br \/>\n<span class=\"token operator\">&#8211;<\/span>rw<span class=\"token operator\">&#8211;<\/span>r<span class=\"token operator\">&#8211;<\/span><span class=\"token operator\">&#8211;<\/span>r<span class=\"token operator\">&#8211;<\/span><span class=\"token operator\">&#8211;<\/span> <span class=\"token number\">1<\/span> root root  <span class=\"token number\">5069051<\/span> Oct <span class=\"token number\">10<\/span> <span class=\"token number\">19<\/span><span class=\"token punctuation\">:<\/span><span class=\"token number\">50<\/span> sentencepiece<span class=\"token punctuation\">.<\/span>bpe<span class=\"token punctuation\">.<\/span>model<br \/>\n<span class=\"token operator\">&#8211;<\/span>rw<span class=\"token operator\">&#8211;<\/span>r<span class=\"token operator\">&#8211;<\/span><span class=\"token operator\">&#8211;<\/span>r<span class=\"token operator\">&#8211;<\/span><span class=\"token operator\">&#8211;<\/span> <span class=\"token number\">1<\/span> root root      <span class=\"token number\">125<\/span> Oct <span class=\"token number\">10<\/span> <span class=\"token number\">19<\/span><span class=\"token punctuation\">:<\/span><span class=\"token number\">53<\/span> special_tokens_map<span class=\"token punctuation\">.<\/span>json<br \/>\n<span class=\"token operator\">&#8211;<\/span>rw<span class=\"token operator\">&#8211;<\/span>r<span class=\"token operator\">&#8211;<\/span><span class=\"token operator\">&#8211;<\/span>r<span class=\"token operator\">&#8211;<\/span><span class=\"token operator\">&#8211;<\/span> <span class=\"token number\">1<\/span> root root      <span class=\"token number\">444<\/span> Oct  <span class=\"token number\">9<\/span> <span class=\"token number\">20<\/span><span class=\"token punctuation\">:<\/span><span class=\"token number\">01<\/span> tokenizer_config<span class=\"token punctuation\">.<\/span>json<br \/>\n<span class=\"token operator\">&#8211;<\/span>rw<span class=\"token operator\">&#8211;<\/span>r<span class=\"token operator\">&#8211;<\/span><span class=\"token operator\">&#8211;<\/span>r<span class=\"token operator\">&#8211;<\/span><span class=\"token operator\">&#8211;<\/span> <span class=\"token number\">1<\/span> root root <span class=\"token number\">17098108<\/span> Oct  <span class=\"token number\">9<\/span> <span class=\"token number\">20<\/span><span class=\"token punctuation\">:<\/span><span class=\"token number\">01<\/span> tokenizer<span class=\"token punctuation\">.<\/span>json<\/p>\n<p>5.\u4fee\u6539py\u6587\u4ef6<\/p>\n<p>model <span class=\"token operator\">&#061;<\/span> Visualized_BGE<span class=\"token punctuation\">(<\/span>model_name_bge <span class=\"token operator\">&#061;<\/span> <span class=\"token string\">&#034;\/data\/suanfa\/meng\/mybge-m3\/bge-m3&#034;<\/span><span class=\"token punctuation\">,<\/span> model_weight<span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;\/data\/suanfa\/meng\/mybge-m3\/Visualized_m3.pth&#034;<\/span><\/p>\n<p>6.\u8fd0\u884c\u62a5\u9519 model.encode\u884c\u62a5\u9519<\/p>\n<p>IndexError<span class=\"token punctuation\">:<\/span> index out of <span class=\"token builtin\">range<\/span> <span class=\"token keyword\">in<\/span> self<\/p>\n<p>7.\u95ee\u9898\u6392\u67e5 \u548c\u89e3\u51b3\u65b9\u6cd52\u4e0b\u8f7d\u4e0b\u6765\u7684\u6587\u4ef6\u8fdb\u884c\u4e86\u5bf9\u6bd4&#xff0c;\u53d1\u73b0\u4e24\u4e2aspecial_tokens_map.json\u6587\u4ef6\u5185\u5bb9\u4e0d\u4e00\u81f4&#xff0c;\u4e8e\u662f\u66ff\u6362\u6210\u89e3\u51b3\u65b9\u6cd52\u4e0b\u8f7d\u4e0b\u6765\u7684\u8be5\u6587\u4ef6\u66ff\u6362\u65b9\u6cd51\u7684\u8be5\u6587\u4ef6&#xff0c;\u95ee\u9898\u6210\u529f\u89e3\u51b3&#xff0c;\u6a21\u578b\u8f93\u51fa&#xff1a;<\/p>\n<p>tensor<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">[<\/span><span class=\"token punctuation\">[<\/span><span class=\"token number\">0.5751<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">)<\/span> tensor<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">[<\/span><span class=\"token punctuation\">[<\/span><span class=\"token number\">0.5856<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">)<\/span><\/p>\n<h3>\u89e3\u51b3\u65b9\u6cd52&#xff1a;\u901a\u8fc7\u955c\u50cf\u4e0b\u8f7d\u6a21\u578b<\/h3>\n<p>1.\u8bbf\u95ee\u7f51\u7ad9&#xff1a;https:\/\/hf-mirror.com\/ \u91cc\u9762\u6709\u8be6\u7ec6\u6b65\u9aa4&#xff1a;<\/p>\n<p>pip install <span class=\"token operator\">&#8211;<\/span>U huggingface_hub<br \/>\nexport HF_ENDPOINT<span class=\"token operator\">&#061;<\/span>https<span class=\"token punctuation\">:<\/span><span class=\"token operator\">\/\/<\/span>hf<span class=\"token operator\">&#8211;<\/span>mirror<span class=\"token punctuation\">.<\/span>com<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb859\u6b21\uff0c\u70b9\u8d5e10\u6b21\uff0c\u6536\u85cf8\u6b21\u30021.\u6253\u5f00hugging face \u5b98\u7f51\uff1ahttps:\/\/huggingface.co\/docs\/transformers\/installation#offline-mode \u5e76\u70b9\u51fbModels\u30021.\u8bbf\u95ee\u7f51\u7ad9\uff1ahttps:\/\/hf-mirror.com\/\u901a\u8fc7\u540e\u9762\u7684\u4e0b\u8f7d\u6309\u94ae\u4e0b\u8f7d\u5708\u51fa\u7684\u4e94\u4e2a\u6587\u4ef6\u5230\u672c\u5730\u3002\u70b9\u51fbfile and versions\u3002model.encode\u884c\u62a5\u9519\u3002\u8f93\u5165\u4f7f\u7528\u7684\u6a21\u578b\uff0c\u5e76\u70b9\u51fb\u6a21\u578b\u30022.\u641c\u7d22\u6211\u4eec\u9700\u8981\u7684\u6a21\u578b\u30024.\u4e0a\u4f20\u6587\u4ef6\u5230\u670d\u52a1\u5668\u3002_\u670d\u52a1\u5668\u8fde\u63a5\u4e0d\u4e0ahugging face<\/p>\n","protected":false},"author":2,"featured_media":18499,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[587,81,86,224],"topic":[],"class_list":["post-18502","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-587","tag-python","tag-86","tag-224"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u670d\u52a1\u5668\u65e0\u6cd5\u8fde\u63a5huggingface\u4e0b\u8f7d\u6a21\u578b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/18502.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u670d\u52a1\u5668\u65e0\u6cd5\u8fde\u63a5huggingface\u4e0b\u8f7d\u6a21\u578b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb859\u6b21\uff0c\u70b9\u8d5e10\u6b21\uff0c\u6536\u85cf8\u6b21\u30021.\u6253\u5f00hugging face \u5b98\u7f51\uff1ahttps:\/\/huggingface.co\/docs\/transformers\/installation#offline-mode \u5e76\u70b9\u51fbModels\u30021.\u8bbf\u95ee\u7f51\u7ad9\uff1ahttps:\/\/hf-mirror.com\/\u901a\u8fc7\u540e\u9762\u7684\u4e0b\u8f7d\u6309\u94ae\u4e0b\u8f7d\u5708\u51fa\u7684\u4e94\u4e2a\u6587\u4ef6\u5230\u672c\u5730\u3002\u70b9\u51fbfile and versions\u3002model.encode\u884c\u62a5\u9519\u3002\u8f93\u5165\u4f7f\u7528\u7684\u6a21\u578b\uff0c\u5e76\u70b9\u51fb\u6a21\u578b\u30022.\u641c\u7d22\u6211\u4eec\u9700\u8981\u7684\u6a21\u578b\u30024.\u4e0a\u4f20\u6587\u4ef6\u5230\u670d\u52a1\u5668\u3002_\u670d\u52a1\u5668\u8fde\u63a5\u4e0d\u4e0ahugging face\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/18502.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-04-18T16:53:16+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418165314-6802837a6d989.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/18502.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/18502.html\",\"name\":\"\u670d\u52a1\u5668\u65e0\u6cd5\u8fde\u63a5huggingface\u4e0b\u8f7d\u6a21\u578b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-04-18T16:53:16+00:00\",\"dateModified\":\"2025-04-18T16:53:16+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/18502.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/18502.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/18502.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u670d\u52a1\u5668\u65e0\u6cd5\u8fde\u63a5huggingface\u4e0b\u8f7d\u6a21\u578b\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u670d\u52a1\u5668\u65e0\u6cd5\u8fde\u63a5huggingface\u4e0b\u8f7d\u6a21\u578b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/18502.html","og_locale":"zh_CN","og_type":"article","og_title":"\u670d\u52a1\u5668\u65e0\u6cd5\u8fde\u63a5huggingface\u4e0b\u8f7d\u6a21\u578b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb859\u6b21\uff0c\u70b9\u8d5e10\u6b21\uff0c\u6536\u85cf8\u6b21\u30021.\u6253\u5f00hugging face \u5b98\u7f51\uff1ahttps:\/\/huggingface.co\/docs\/transformers\/installation#offline-mode \u5e76\u70b9\u51fbModels\u30021.\u8bbf\u95ee\u7f51\u7ad9\uff1ahttps:\/\/hf-mirror.com\/\u901a\u8fc7\u540e\u9762\u7684\u4e0b\u8f7d\u6309\u94ae\u4e0b\u8f7d\u5708\u51fa\u7684\u4e94\u4e2a\u6587\u4ef6\u5230\u672c\u5730\u3002\u70b9\u51fbfile and versions\u3002model.encode\u884c\u62a5\u9519\u3002\u8f93\u5165\u4f7f\u7528\u7684\u6a21\u578b\uff0c\u5e76\u70b9\u51fb\u6a21\u578b\u30022.\u641c\u7d22\u6211\u4eec\u9700\u8981\u7684\u6a21\u578b\u30024.\u4e0a\u4f20\u6587\u4ef6\u5230\u670d\u52a1\u5668\u3002_\u670d\u52a1\u5668\u8fde\u63a5\u4e0d\u4e0ahugging face","og_url":"https:\/\/www.wsisp.com\/helps\/18502.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-04-18T16:53:16+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418165314-6802837a6d989.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"1 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/18502.html","url":"https:\/\/www.wsisp.com\/helps\/18502.html","name":"\u670d\u52a1\u5668\u65e0\u6cd5\u8fde\u63a5huggingface\u4e0b\u8f7d\u6a21\u578b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-04-18T16:53:16+00:00","dateModified":"2025-04-18T16:53:16+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/18502.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/18502.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/18502.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u670d\u52a1\u5668\u65e0\u6cd5\u8fde\u63a5huggingface\u4e0b\u8f7d\u6a21\u578b"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/18502","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=18502"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/18502\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/18499"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=18502"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=18502"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=18502"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=18502"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}