Instructions to use KayaTechAI/Financial-Context with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use KayaTechAI/Financial-Context with Transformers:
# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("KayaTechAI/Financial-Context", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Unsloth Studio
How to use KayaTechAI/Financial-Context with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for KayaTechAI/Financial-Context to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for KayaTechAI/Financial-Context to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for KayaTechAI/Financial-Context to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="KayaTechAI/Financial-Context", max_seq_length=2048, )
Upload model trained with Unsloth
Browse filesUpload model trained with Unsloth 2x faster
- chat_template.jinja +4 -3
chat_template.jinja
CHANGED
|
@@ -18,16 +18,17 @@
|
|
| 18 |
{%- for forward_message in messages %}
|
| 19 |
{%- set index = (messages|length - 1) - loop.index0 %}
|
| 20 |
{%- set message = messages[index] %}
|
|
|
|
| 21 |
{%- set tool_start = '<tool_response>' %}
|
| 22 |
{%- set tool_start_length = tool_start|length %}
|
| 23 |
-
{%- set start_of_message =
|
| 24 |
{%- set tool_end = '</tool_response>' %}
|
| 25 |
{%- set tool_end_length = tool_end|length %}
|
| 26 |
-
{%- set start_pos = (
|
| 27 |
{%- if start_pos < 0 %}
|
| 28 |
{%- set start_pos = 0 %}
|
| 29 |
{%- endif %}
|
| 30 |
-
{%- set end_of_message =
|
| 31 |
{%- if ns.multi_step_tool and message.role == "user" and not(start_of_message == tool_start and end_of_message == tool_end) %}
|
| 32 |
{%- set ns.multi_step_tool = false %}
|
| 33 |
{%- set ns.last_query_index = index %}
|
|
|
|
| 18 |
{%- for forward_message in messages %}
|
| 19 |
{%- set index = (messages|length - 1) - loop.index0 %}
|
| 20 |
{%- set message = messages[index] %}
|
| 21 |
+
{%- set current_content = message.content if message.content is not none else '' %}
|
| 22 |
{%- set tool_start = '<tool_response>' %}
|
| 23 |
{%- set tool_start_length = tool_start|length %}
|
| 24 |
+
{%- set start_of_message = current_content[:tool_start_length] %}
|
| 25 |
{%- set tool_end = '</tool_response>' %}
|
| 26 |
{%- set tool_end_length = tool_end|length %}
|
| 27 |
+
{%- set start_pos = (current_content|length) - tool_end_length %}
|
| 28 |
{%- if start_pos < 0 %}
|
| 29 |
{%- set start_pos = 0 %}
|
| 30 |
{%- endif %}
|
| 31 |
+
{%- set end_of_message = current_content[start_pos:] %}
|
| 32 |
{%- if ns.multi_step_tool and message.role == "user" and not(start_of_message == tool_start and end_of_message == tool_end) %}
|
| 33 |
{%- set ns.multi_step_tool = false %}
|
| 34 |
{%- set ns.last_query_index = index %}
|