更新於 15 個月前
15 個月前
bce5c62dfd7d · 6.9GB
模型
架構llama
·
參數13B
·
量化Q3_K_L
6.9GB
範本
[INST] <<SYS>>{{ .System }}<</SYS>> {{ .Prompt }} [/INST]
59B
參數
{ "rope_frequency_base": 1000000, "stop": [ "[INST]", "[/INST]", "<<
120B
授權條款
# Llama Code 可接受使用政策 Meta 致力於推廣其工具的安全和公平使用
4.8kB
授權條款
LLAMA 2 社群授權協議 Llama 2 版本發布日期:2023 年 7 月 18 日 「協議」是指
7.0kB
Readme
Code Llama 是一個用於產生和討論程式碼的模型,建立於 Llama 2 之上。它的設計旨在使開發人員的工作流程更快速有效,並讓使用者更容易學習編碼。它可以產生程式碼和關於程式碼的自然語言。Code Llama 支援當今許多最流行的程式語言,包括 Python、C++、Java、PHP、Typescript (Javascript)、C#、Bash 等。
參數計數
參數計數 | ||
---|---|---|
70 億 | 檢視 | ollama run codellama:7b |
130 億 | 檢視 | ollama run codellama:13b |
340 億 | 檢視 | ollama run codellama:34b |
700 億 | 檢視 | ollama run codellama:70b |
使用方式
CLI
ollama run codellama "Write me a function that outputs the fibonacci sequence"
API
curl -X POST https://127.0.0.1:11434/api/generate -d '{
"model": "codellama",
"prompt": "Write me a function that outputs the fibonacci sequence"
}'
變體版本
instruct |
微調以產生自然語言中有幫助且安全的答案 |
python |
Code Llama 的一個特殊變體版本,在 1000 億個 Python 程式碼 tokens 上進一步微調 |
code |
用於程式碼完成的基本模型 |
範例提示
提問
ollama run codellama:7b-instruct 'You are an expert programmer that writes simple, concise code and explanations. Write a python function to generate the nth fibonacci number.'
填空中間 (FIM) 或填充
ollama run codellama:7b-code '<PRE> def compute_gcd(x, y): <SUF>return result <MID>'
填空中間 (FIM) 是一種特殊的提示格式,程式碼完成模型支援完成兩個已編寫程式碼區塊之間的程式碼。Code Llama 期望用於程式碼填充的特定格式
<PRE> {prefix} <SUF>{suffix} <MID>
<PRE>
、<SUF>
和 <MID>
是引導模型的特殊 tokens。
程式碼審查
ollama run codellama '
Where is the bug in this code?
def fib(n):
if n <= 0:
return n
else:
return fib(n-1) + fib(n-2)
'
編寫測試
ollama run codellama "write a unit test for this function: $(cat example.py)"
程式碼完成
ollama run codellama:7b-code '# A simple python function to remove whitespace from a string:'