返回模型
说明文档
https://huggingface.co/PleIAs/Pleias-Nano,包含 ONNX 权重,以兼容 Transformers.js。
用法 (Transformers.js)
如果你还没有安装,可以通过 NPM 安装 Transformers.js JavaScript 库:
npm i @huggingface/transformers
示例: 使用 onnx-community/Pleias-Nano 进行文本生成。
import { pipeline } from "@huggingface/transformers";
// 创建文本生成管道
const generator = await pipeline("text-generation", "onnx-community/Pleias-Nano", { dtype: "q4" });
// 构建 RAG 提示词
const prompt = `
<|query_start|>Is Wikipedia reliable?<|query_end|>
<|source_start|><|source_id_start|>ebea70a3502acfbd<|source_id_end|>Articles for traditional encyclopedias such as Encyclopædia Britannica are written by experts, lending such encyclopedias a reputation for accuracy.[144] However, a peer review in 2005 of forty-two scientific entries on both Wikipedia and Encyclopædia Britannica by the science journal Nature found few differences in accuracy, and concluded that "the average science entry in Wikipedia contained around four inaccuracies; Britannica, about three."[145] Joseph Reagle suggested that while the study reflects "a topical strength of Wikipedia contributors" in science articles, "Wikipedia may not have fared so well using a random sampling of articles or on humanities subjects."<|source_end|>
<|source_start|><|source_id_start|>5f862e733d38288e<|source_id_end|>As a consequence of the open structure, Wikipedia "makes no guarantee of validity" of its content, since no one is ultimately responsible for any claims appearing in it.[W 54] Concerns have been raised by PC World in 2009 regarding the lack of accountability that results from users' anonymity, the insertion of false information,[152] vandalism, and similar problems. Legal Research in a Nutshell (2011), cites Wikipedia as a "general source" that "can be a real boon" in "coming up to speed in the law governing a situation" and, "while not authoritative, can provide basic facts as well as leads to more in-depth resources".<|source_end|>
<|source_start|><|source_id_start|>354fa4908152b336<|source_id_end|>Wikipedia's open structure inherently makes it an easy target for Internet trolls, spammers, and various forms of paid advocacy seen as counterproductive to the maintenance of a neutral and verifiable online encyclopedia.[70][W 55] In response to paid advocacy editing and undisclosed editing issues, Wikipedia was reported in an article in The Wall Street Journal to have strengthened its rules and laws against undisclosed editing.[162] The article stated that: "Beginning Monday [from the date of the article, June 16, 2014], changes in Wikipedia's terms of use will require anyone paid to edit articles to disclose that arrangement. Katherine Maher, the nonprofit Wikimedia Foundation's chief communications officer, said the changes address a sentiment among volunteer editors that 'we're not an advertising service; we're an encyclopedia.'"<|source_end|>
<|source_analysis_start|>
`.trim();
// 生成回复
const output = await generator(prompt, { max_new_tokens: 1024, do_sample: false, return_full_text: false });
console.log(output[0].generated_text);
<details>
<summary>示例输出</summary>
The user is asking for information on how Wikipedia articles are verified. The provided references include a variety of sources that discuss different aspects of Wikipedia's reliability, including its coverage, the quality of articles, and the methods used to verify information. The most relevant references for answering this query are **ebea70a3502acfbd**, which provides a direct assessment of the accuracy of Wikipedia articles, and **5f862e733d38288e**, which discusses the lack of accountability and the potential for false information. Other references, such as **d0d0d0d0d0d0d0d0** and **354fa4908152b336**, provide context on the structure and reliability of Wikipedia but are less directly related to verification.
Wikipedia articles are generally considered to be reliable due to several factors that contribute to their trustworthiness. Firstly, Wikipedia's open structure allows it to be a "general source" that can provide basic facts as well as leads to more in-depth resources<ref name="5f862e733d38288e">"Concerns have been raised by PC World in 2009 regarding the lack of accountability that results from users' anonymity, the insertion of false information, vandalism, and similar problems."</ref>. This makes it a valuable resource for those seeking to understand complex topics.
In terms of accuracy, Wikipedia has been praised for its "open structure," which allows it to be a "general source" that can provide basic facts as well as leads to more in-depth resources<ref name="5f862e733d38288e">"Concerns have been raised by PC World in 2009 regarding the lack of accountability that results from users' anonymity, the insertion of false information, vandalism, and similar problems."</ref>. This openness is seen as a significant advantage, allowing readers to engage with the content more deeply and make informed decisions.
However, there are still some areas where Wikipedia's reliability can be improved. For instance, there have been concerns about the accuracy of entries on subjects such as science, where "a peer review in 2005 of forty-two scientific entries on both Wikipedia and Encyclopædia Britannica by the science journal Nature found few differences in accuracy"<ref name="ebea70a3502acfbd">"a peer review in 2005 of forty-two scientific entries on both Wikipedia and Encyclopædia Britannica by the science journal Nature found few differences in accuracy"</ref>. This suggests that while Wikipedia is generally considered to be a reliable source, there is still room for improvement in terms of accuracy.
Additionally, there have been instances where articles have been found to contain inaccuracies, such as "a peer review in 2005 of forty-two scientific entries on both Wikipedia and Encyclopædia Britannica by the science journal Nature found few differences in accuracy"<ref name="ebea70a3502acfbd">"a peer review in 2005 of forty-two scientific entries on both Wikipedia and Encyclopædia Britannica by the science journal Nature found few differences in accuracy"</ref>. This highlights the ongoing challenge of ensuring the highest possible level of accuracy in Wikipedia articles.
Overall, while Wikipedia articles are generally considered to be reliable, there is still room for improvement in terms of accuracy. This improvement could involve refining the structure of the articles, enhancing the quality of the information, and ensuring that the articles are updated regularly.
</details>
注意:为 ONNX 权重创建单独的仓库是临时解决方案,直到 WebML 获得更多关注。如果你想让你的模型支持网页端,我们建议使用 🤗 Optimum 转换为 ONNX 格式,并按照此仓库的结构组织(将 ONNX 权重放在名为 onnx 的子文件夹中)。
onnx-community/Pleias-Nano
作者 onnx-community
text-generation
transformers.js
↓ 0
♥ 0
创建时间: 2024-12-05 22:35:11+00:00
更新时间: 2025-03-06 17:20:33+00:00
在 Hugging Face 上查看文件 (17)
.gitattributes
README.md
config.json
generation_config.json
onnx/model.onnx
ONNX
onnx/model.onnx_data
onnx/model_bnb4.onnx
ONNX
onnx/model_fp16.onnx
ONNX
onnx/model_fp16.onnx_data
onnx/model_int8.onnx
ONNX
onnx/model_q4.onnx
ONNX
onnx/model_q4f16.onnx
ONNX
onnx/model_quantized.onnx
ONNX
onnx/model_uint8.onnx
ONNX
special_tokens_map.json
tokenizer.json
tokenizer_config.json