Instructions to use kaivoss/AliceAI-T5-35B-A0.6B-chat-lora-v6 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use kaivoss/AliceAI-T5-35B-A0.6B-chat-lora-v6 with PEFT:
from peft import PeftModel from transformers import AutoModelForSeq2SeqLM base_model = AutoModelForSeq2SeqLM.from_pretrained("yandex/AliceAI-T5-35B-A0.6B") model = PeftModel.from_pretrained(base_model, "kaivoss/AliceAI-T5-35B-A0.6B-chat-lora-v6") - Notebooks
- Google Colab
- Kaggle
Download glm_tools.py from kaivoss/AliceAI-T5-35B-A0.6B-chat-lora-v6: direct link, hf CLI and curl.
- Browser
- Download file 849 Bytes
-
https://huggingface.co/kaivoss/AliceAI-T5-35B-A0.6B-chat-lora-v6/resolve/main/glm_tools.py
- Command line
-
hf download hf://kaivoss/AliceAI-T5-35B-A0.6B-chat-lora-v6/glm_tools.py
-
curl -L -o glm_tools.py https://huggingface.co/kaivoss/AliceAI-T5-35B-A0.6B-chat-lora-v6/resolve/main/glm_tools.py
849 Bytes
| """Render an OpenAI `tools` list into the system-prompt text GLM-5.3-Flash's own chat template produces. | |
| Training data and the serving shim both use this, so the model sees the same tools block at inference as in training. | |
| """ | |
| import json | |
| from pathlib import Path | |
| import jinja2 | |
| HERE = Path(__file__).parent | |
| _glm = None | |
| def tools_block(tools): | |
| global _glm | |
| if _glm is None: | |
| env = jinja2.Environment(trim_blocks=True, lstrip_blocks=True, extensions=["jinja2.ext.loopcontrols"]) | |
| env.filters["tojson"] = lambda v, ensure_ascii=False, indent=None: json.dumps(v, ensure_ascii=ensure_ascii, indent=indent) | |
| _glm = env.from_string((HERE / "glm_tools_template.jinja").read_text(encoding="utf-8")) | |
| parts = _glm.render(messages=[], tools=tools).split("<|system|>") | |
| return parts[2].lstrip("\n") | |