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

Code interpreter #3173

Merged
merged 19 commits into from
Dec 19, 2024
Merged

Code interpreter #3173

merged 19 commits into from
Dec 19, 2024

Conversation

manyoso
Copy link
Collaborator

@manyoso manyoso commented Nov 7, 2024

This is a WIP for code interpreter tool call based upon the jinja pr.

Here is the latest jinja template I'm using for Qwen2.5-Coder-7B:

{{- '<|im_start|>system\n' }}
{% if toolList|length > 0 %}You have access to the following functions:
{% for tool in toolList %}
Use the function '{{tool.function}}' to: '{{tool.description}}'
{% if tool.parameters|length > 0 %}
parameters:
{% for info in tool.parameters %}
  {{info.name}}:
    type: {{info.type}}
    description: {{info.description}}
    required: {{info.required}}
{% endfor %}
{% endif %}
# Tool Instructions
If you CHOOSE to call this function ONLY reply with the following format:
'{{tool.symbolicFormat}}'
Here is an example. If the user says, '{{tool.examplePrompt}}', then you reply
'{{tool.exampleCall}}'
After the result you might reply with, '{{tool.exampleReply}}'
{% endfor %}
You MUST include both the start and end tags when you use a function.

You are a helpful AI assistant who uses the functions to break down, analyze, perform, and verify complex reasoning tasks. You SHOULD try to verify your answers using the functions where possible.
{% endif %}
{{- '<|im_end|>\n' }}
{% for message in messages %}
{{'<|im_start|>' + message['role'] + '\n' + message['content'] + '<|im_end|>' + '\n' }}
{% endfor %}
{% if add_generation_prompt %}
{{ '<|im_start|>assistant\n' }}
{% endif %}

@manyoso manyoso marked this pull request as draft November 7, 2024 15:40
@manyoso manyoso force-pushed the code_interpreter branch 2 times, most recently from 17ea8ff to 8eb2549 Compare November 8, 2024 13:41
@manyoso manyoso changed the title WIP Code interpreter Code interpreter Dec 18, 2024
@manyoso manyoso marked this pull request as ready for review December 18, 2024 22:56
manyoso and others added 19 commits December 19, 2024 16:30
Signed-off-by: Adam Treat <[email protected]>
Signed-off-by: Jared Van Bortel <[email protected]>
Co-authored-by: Jared Van Bortel <[email protected]>
Signed-off-by: Jared Van Bortel <[email protected]>
Signed-off-by: Adam Treat <[email protected]>
Signed-off-by: Adam Treat <[email protected]>
Signed-off-by: Adam Treat <[email protected]>
Signed-off-by: Adam Treat <[email protected]>
@manyoso manyoso merged commit 1c89447 into main Dec 19, 2024
3 of 8 checks passed
cebtenzzre added a commit that referenced this pull request Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants