13 个月前更新
13 个月前
4f3f9f884a09 · 1.9GB
模型
架构phi2
·
参数2.78B
·
量化Q5_K_S
1.9GB
参数
{ "stop": [ "User:", "Assistant:", "System:" ] }
42B
模板
{{ if .System }}System: {{ .System }}{{ end }} User: {{ .Prompt }} Assistant:
77B
系统
A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful
132B
许可证
MIT License Permission is hereby granted, free of charge, to any person obtaining a copy of this so
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 http://127.0.0.1:11434/api/chat -d '{
"model": "phi",
"messages": [
{ "role": "user", "content": "why is the sky blue?" }
]
}'
示例提示(原始模式)
当在 Ollama 的 API 中使用原始模式时,Phi 也能很好地响应各种提示格式,这会绕过所有默认的提示模板。
指令
curl http://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 http://127.0.0.1:11434/api/generate -d '{
"model": "phi",
"prompt": "def print_prime(n):\n ",
"raw": true,
"stream": false
}'
文本补全
curl http://127.0.0.1:11434/api/generate -d '{
"model": "phi",
"prompt": "There once was a mouse named",
"raw": true,
"stream": false
}'