add insert support to generate endpoint (#215)

* add suffix

* update fill-in-the-middle example

* keep example

* lint

* variables
This commit is contained in:
royjhan
2024-07-18 11:04:17 -07:00
committed by GitHub
parent b0ea6d9e44
commit 33c4b61ff9
3 changed files with 17 additions and 3 deletions
+3 -3
View File
@@ -1,16 +1,16 @@
from ollama import generate
prefix = '''def remove_non_ascii(s: str) -> str:
prompt = '''def remove_non_ascii(s: str) -> str:
""" '''
suffix = """
return result
"""
response = generate(
model='codellama:7b-code',
prompt=f'<PRE> {prefix} <SUF>{suffix} <MID>',
prompt=prompt,
suffix=suffix,
options={
'num_predict': 128,
'temperature': 0,