Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use “/api/infill” instead of “/api/generate” #61

Open
1 task done
zhengxs2018 opened this issue Jun 26, 2024 · 0 comments
Open
1 task done

Use “/api/infill” instead of “/api/generate” #61

zhengxs2018 opened this issue Jun 26, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@zhengxs2018
Copy link
Collaborator

Validations

  • I'm not able to find an open issue that requests the same enhancement

Problem

The endpoints "/chat/completions" or "/api/generate" are well-suited for writing test cases or generating complete code snippets.

Writing tests:

write a unit test for this function: $(cat example.py)

Code completions:

# A simple python function to remove whitespace from a string:

However, these endpoints are not very effective when dealing with non-standard or incomplete code.

FIM (Fill-in-the-Middle) is a specialized prompting format supported by code completion models, allowing completion of code between two pre-written code segments.

<PRE> def compute_gcd(x, y): <SUF>return result <MID>

<PRE>, <SUF> and <MID> are special tokens that guide the model.

The challenge lies in the fact that different models use different special tokens for this purpose. Developers from llama.cpp and ollama have already identified this issue.

Links:

Solution

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants