Nah, maybe better if I delete this
Browse files
Modelfile
DELETED
@@ -1,103 +0,0 @@
|
|
1 |
-
|
2 |
-
FROM /content/xMaulana/FinMatcha-3b-GGUF/unsloth.F16.gguf
|
3 |
-
TEMPLATE """
|
4 |
-
{{- bos_token }}
|
5 |
-
{%- if custom_tools is defined %}
|
6 |
-
{%- set tools = custom_tools %}
|
7 |
-
{%- endif %}
|
8 |
-
{%- if not tools_in_user_message is defined %}
|
9 |
-
{%- set tools_in_user_message = true %}
|
10 |
-
{%- endif %}
|
11 |
-
{%- if not date_string is defined %}
|
12 |
-
{%- if strftime_now is defined %}
|
13 |
-
{%- set date_string = strftime_now("%d %b %Y") %}
|
14 |
-
{%- else %}
|
15 |
-
{%- set date_string = "26 Jul 2024" %}
|
16 |
-
{%- endif %}
|
17 |
-
{%- endif %}
|
18 |
-
{%- if not tools is defined %}
|
19 |
-
{%- set tools = none %}
|
20 |
-
{%- endif %}
|
21 |
-
|
22 |
-
{#- This block extracts the system message, so we can slot it into the right place. #}
|
23 |
-
{%- if messages[0]['role'] == 'system' %}
|
24 |
-
{%- set system_message = messages[0]['content']|trim %}
|
25 |
-
{%- set messages = messages[1:] %}
|
26 |
-
{%- else %}
|
27 |
-
{%- set system_message = "" %}
|
28 |
-
{%- endif %}
|
29 |
-
|
30 |
-
{#- System message #}
|
31 |
-
{{- "<|start_header_id|>system<|end_header_id|>\n\n" }}
|
32 |
-
{%- if tools is not none %}
|
33 |
-
{{- "Environment: ipython\n" }}
|
34 |
-
{%- endif %}
|
35 |
-
{{- "Cutting Knowledge Date: December 2024\n" }}
|
36 |
-
{{- "Today Date: " + date_string + "\n\n" }}
|
37 |
-
{%- if tools is not none and not tools_in_user_message %}
|
38 |
-
{{- "You have access to the following functions. To call a function, please respond with JSON for a function call." }}
|
39 |
-
{{- 'Respond in the format {"name": function name, "parameters": dictionary of argument name and its value}.' }}
|
40 |
-
{{- "Do not use variables.\n\n" }}
|
41 |
-
{%- for t in tools %}
|
42 |
-
{{- t | tojson(indent=4) }}
|
43 |
-
{{- "\n\n" }}
|
44 |
-
{%- endfor %}
|
45 |
-
{%- endif %}
|
46 |
-
{{- system_message }}
|
47 |
-
{{- "<|eot_id|>" }}
|
48 |
-
|
49 |
-
{#- Custom tools are passed in a user message with some extra guidance #}
|
50 |
-
{%- if tools_in_user_message and not tools is none %}
|
51 |
-
{#- Extract the first user message so we can plug it in here #}
|
52 |
-
{%- if messages | length != 0 %}
|
53 |
-
{%- set first_user_message = messages[0]['content']|trim %}
|
54 |
-
{%- set messages = messages[1:] %}
|
55 |
-
{%- else %}
|
56 |
-
{{- raise_exception("Cannot put tools in the first user message when there's no first user message!") }}
|
57 |
-
{%- endif %}
|
58 |
-
{{- '<|start_header_id|>user<|end_header_id|>\n\n' -}}
|
59 |
-
{{- "Given the following functions, please respond with a JSON for a function call " }}
|
60 |
-
{{- "with its proper arguments that best answers the given prompt.\n\n" }}
|
61 |
-
{{- 'Respond in the format {"name": function name, "parameters": dictionary of argument name and its value}.' }}
|
62 |
-
{{- "Do not use variables.\n\n" }}
|
63 |
-
{%- for t in tools %}
|
64 |
-
{{- t | tojson(indent=4) }}
|
65 |
-
{{- "\n\n" }}
|
66 |
-
{%- endfor %}
|
67 |
-
{{- first_user_message + "<|eot_id|>"}}
|
68 |
-
{%- endif %}
|
69 |
-
|
70 |
-
{%- for message in messages %}
|
71 |
-
{%- if not (message.role == 'ipython' or message.role == 'tool' or 'tool_calls' in message) %}
|
72 |
-
{{- '<|start_header_id|>' + message['role'] + '<|end_header_id|>\n\n'+ message['content'] | trim + '<|eot_id|>' }}
|
73 |
-
{%- elif 'tool_calls' in message %}
|
74 |
-
{%- if not message.tool_calls|length == 1 %}
|
75 |
-
{{- raise_exception("This model only supports single tool-calls at once!") }}
|
76 |
-
{%- endif %}
|
77 |
-
{%- set tool_call = message.tool_calls[0].function %}
|
78 |
-
{{- '<|start_header_id|>assistant<|end_header_id|>\n\n' -}}
|
79 |
-
{{- '{"name": "' + tool_call.name + '", ' }}
|
80 |
-
{{- '"parameters": ' }}
|
81 |
-
{{- tool_call.arguments | tojson }}
|
82 |
-
{{- "}" }}
|
83 |
-
{{- "<|eot_id|>" }}
|
84 |
-
{%- elif message.role == "tool" or message.role == "ipython" %}
|
85 |
-
{{- "<|start_header_id|>ipython<|end_header_id|>\n\n" }}
|
86 |
-
{%- if message.content is mapping or message.content is iterable %}
|
87 |
-
{{- message.content | tojson }}
|
88 |
-
{%- else %}
|
89 |
-
{{- message.content }}
|
90 |
-
{%- endif %}
|
91 |
-
{{- "<|eot_id|>" }}
|
92 |
-
{%- endif %}
|
93 |
-
{%- endfor %}
|
94 |
-
{%- if add_generation_prompt %}
|
95 |
-
{{- '<|start_header_id|>assistant<|end_header_id|>\n\n' }}
|
96 |
-
{%- endif %}
|
97 |
-
"""
|
98 |
-
PARAMETER stop "<|begin_of_text|>"
|
99 |
-
PARAMETER stop "<|start_header_id|>"
|
100 |
-
PARAMETER stop "<|end_header_id|>"
|
101 |
-
PARAMETER stop "<|eot_id|>"
|
102 |
-
PARAMETER temperature 1.5
|
103 |
-
PARAMETER min_p 0.1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|