Views
No views yet
1pip install huggingface-hub
2python -c "from huggingface_hub import hf_hub_download; hf_hub_download(repo_id='MTSAIR/Kodify-Nano-GGUF', filename='Kodify_Nano_q4_k_s.gguf', local_dir='./models')"FROM ./models/Kodify_Nano_q4_k_s.gguf
PARAMETER temperature 0.4
PARAMETER top_p 0.8
PARAMETER num_ctx 8192
TEMPLATE """<s>[INST] {{ .System }} {{ .Prompt }} [/INST]"""pip install ollama1import ollama
2
3response = ollama.generate(
4 model="kodify-nano",
5 prompt="Write a Python function to calculate factorial",
6 options={
7 "temperature": 0.4,
8 "top_p": 0.8,
9 "num_ctx": 8192
10 }
11)
12
13print(response['response'])1response = ollama.generate(
2 model="kodify-nano",
3 prompt="""<s>[INST]
4Write a Python function that:
51. Accepts a list of numbers
62. Returns the median value
7[/INST]""",
8 options={"max_tokens": 512}
9)
10
11### Code Refactoring
12response = ollama.generate(
13 model="kodify-nano",
14 prompt="""<s>[INST]
15Refactor this Python code:
16
17def calc(a,b):
18 s = a + b
19 d = a - b
20 p = a * b
21 return s, d, p
22[/INST]""",
23 options={"temperature": 0.3}
24)