14 個月前更新
14 個月前
012265cbf343 · 1.8GB
模型
archphi2
·
parameters2.78B
·
quantizationQ4_1
1.8GB
參數
{ "stop": [ "User:", "Assistant:", "System:" ] }
42B
模板
{{ if .System }}System: {{ .System }}{{ end }} User: {{ .Prompt }} Assistant:
77B
系統
一個好奇的使用者和人工智慧助理之間的對話。助理會給予有幫助的回應
132B
授權條款
MIT 授權條款 茲免費授予任何人取得本軟體副本的權利,以進行
1.0kB
Readme
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://localhost:11434/api/chat -d '{
"model": "phi",
"messages": [
{ "role": "user", "content": "why is the sky blue?" }
]
}'
範例提示(原始模式)
當在 Ollama 的 API 中使用 原始模式 時,Phi 對於各種提示格式也有良好的回應,這會繞過所有預設提示範本
指示
curl http://localhost: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://localhost:11434/api/generate -d '{
"model": "phi",
"prompt": "def print_prime(n):\n ",
"raw": true,
"stream": false
}'
文字完成
curl http://localhost:11434/api/generate -d '{
"model": "phi",
"prompt": "There once was a mouse named",
"raw": true,
"stream": false
}'