13 個月前更新
13 個月前
c5f597fa19b3 · 1.2GB
模型
archphi2
·
parameters2.78B
·
quantizationQ2_K
1.2GB
參數
{ "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
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 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
}'