上次更新 13 個月前
13 個月前
e2fd6321a5fe · 1.6GB
model
archphi2
·
parameters2.78B
·
quantizationQ4_0
1.6GB
params
{ "stop": [ "User:", "Assistant:", "System:" ] }
42B
template
{{ if .System }}System: {{ .System }}{{ end }} User: {{ .Prompt }} Assistant:
77B
system
一個好奇的使用者和人工智慧助理之間的對話。 助理會給予有幫助的
132B
license
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
}'