Skip to content
This repository was archived by the owner on Jun 5, 2025. It is now read-only.

Commit 4e2c5f1

Browse files
committed
Adjust the Ollama FIM testcase to match the model we are using
The FIM format didn't match the model it seemed. I replaced it with a dump of a FIM message I received from Continue.
1 parent e91201d commit 4e2c5f1

File tree

1 file changed

+23
-39
lines changed

1 file changed

+23
-39
lines changed

tests/integration/testcases.yaml

Lines changed: 23 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -297,48 +297,32 @@ testcases:
297297
url: http://127.0.0.1:8989/ollama/api/generate
298298
data: |
299299
{
300-
"model": "qwen2.5-coder:0.5b",
301-
"max_tokens": 4096,
302-
"temperature": 0,
303300
"stream": true,
304-
"stop": [
305-
"<fim_prefix>",
306-
"<fim_suffix>",
307-
"<fim_middle>",
308-
"<file_sep>",
309-
"</fim_middle>",
310-
"</code>",
311-
"/src/",
312-
"#- coding: utf-8",
313-
"```",
314-
""
315-
],
301+
"model": "qwen2.5-coder:0.5b",
302+
"raw": true,
303+
"options": {
304+
"temperature": 0.01,
305+
"num_predict": 4096,
306+
"stop": [
307+
"<|endoftext|>",
308+
"<|fim_prefix|>",
309+
"<|fim_middle|>",
310+
"<|fim_suffix|>",
311+
"<|fim_pad|>",
312+
"<|repo_name|>",
313+
"<|file_sep|>",
314+
"<|im_start|>",
315+
"<|im_end|>",
316+
"/src/",
317+
"#- coding: utf-8",
318+
"```"
319+
],
320+
"num_ctx": 8096
321+
},
316322
"prompt":"<|fim_prefix|>\n# codegate/test.py\nimport invokehttp\nimport requests\n\nkey = \"mysecret-key\"\n\ndef call_api():\n <|fim_suffix|>\n\n\ndata = {'key1': 'test1', 'key2': 'test2'}\nresponse = call_api('http://localhost:8080', method='post', data='data')\n<|fim_middle|>"
317323
}
318324
likes: |
319325
```python
320-
import invokehttp
321-
import requests
322-
323-
key = "mysecret-key"
324-
325-
def call_api(url, method='get', data=None):
326-
headers = {
327-
'Authorization': f'Bearer {key}'
328-
}
329-
330-
if method == 'get':
331-
response = requests.get(url, headers=headers)
332-
elif method == 'post':
333-
response = requests.post(url, headers=headers, json=data)
334-
else:
335-
raise ValueError("Unsupported HTTP method")
336-
337-
return response
338-
339-
data = {'key1': 'test1', 'key2': 'test2'}
340-
response = call_api('http://localhost:8080', method='post', data=data)
341-
342-
print(response.status_code)
343-
print(response.json())
326+
if __name__ == '__main__':
327+
invokehttp.run(call_api)
344328
```

0 commit comments

Comments
 (0)