更新於 13 個月前
13 個月前
e2fd6321a5fe · 1.6GB
模型
archphi2
·
parameters2.78B
·
quantizationQ4_0
1.6GB
參數
{ "stop": [ "User:", "Assistant:", "System:" ] }
42B
模板
{{ if .System }}System: {{ .System }}{{ end }} User: {{ .Prompt }} Assistant:
77B
系統
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 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
}'