11个月前更新
11个月前
4ceb511ce989 · 1.3GB
模型
架构phi2
·
参数27.8亿
·
量化Q3_K_S
1.3GB
参数
{ "stop": [ "User:", "Assistant:", "System:" ] }
42B
模板
{{ if .System }}System: {{ .System }}{{ end }} User: {{ .Prompt }} Assistant:
77B
系统
好奇的用户和人工智能助手之间的聊天。助手提供有帮助的
132B
许可证
MIT许可证 特此免费授予获得本软件副本的任何人无偿使用本软件的权利,包括但不限于使用、复制、修改、
1.0kB
自述文件
Phi-2是一个小型语言模型,能够进行常识推理和语言理解。在参数少于130亿的语言模型中,它展现了“最先进的性能”。
示例提示
默认情况下,phi
包含一个为多轮对话设计的聊天提示模板。
% ollama run phi
>>> Hello, can you help me find my way to Toronto?
Certainly! What is the exact location in Toronto that you are looking for?
>>> Yonge & Bloor
Sure, Yonge and Bloor is a busy intersection in downtown Toronto. Would you like to take public transportation or drive there?
>>> Public transportation
Great! The easiest way to get there is by taking the TTC subway. You can take Line 1, which runs along Yonge Street and passes through downtown Toronto.
使用Ollama的API
curl https://127.0.0.1:11434/api/chat -d '{
"model": "phi",
"messages": [
{ "role": "user", "content": "why is the sky blue?" }
]
}'
示例提示(原始模式)
在使用Ollama API的原始模式(绕过所有默认提示模板)时,Phi也能很好地响应各种提示格式。
指令
curl https://127.0.0.1:11434/api/generate -d '{
"model": "phi",
"prompt": "Instruct: Write a detailed analogy between mathematics and a lighthouse.\nOutput:",
"options": {
"stop": ["Instruct:", "Output:"]
},
"raw": true,
"stream": false
}'
代码补全
curl https://127.0.0.1:11434/api/generate -d '{
"model": "phi",
"prompt": "def print_prime(n):\n ",
"raw": true,
"stream": false
}'
文本补全
curl https://127.0.0.1:11434/api/generate -d '{
"model": "phi",
"prompt": "There once was a mouse named",
"raw": true,
"stream": false
}'