Run this model with HF Jobs
Run shellzero/gemma2-2b-ft-law-data-tag-generation on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/shellzero/gemma2-2b-ft-law-data-tag-generation. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/shellzero/gemma2-2b-ft-law-data-tag-generation on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use shellzero/gemma2-2b-ft-law-data-tag-generation with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use shellzero/gemma2-2b-ft-law-data-tag-generation with MLX:
# Download the model from the Hub pip install huggingface_hub[hf_xet] hf download shellzero/gemma2-2b-ft-law-data-tag-generation --local-dir gemma2-2b-ft-law-data-tag-generation
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Atomic Chat
shellzero/gemma2-2b-ft-law-data-tag-generation
This model was converted to MLX format from google/gemma-7b-it.
Refer to the original model card for more details on the model.
pip install mlx-lm
The model was LoRA fine-tuned on the ymoslem/Law-StackExchange and Synthetic data generated from
GPT-4o and GPT-35-Turbo using the format below, for 1500 steps using mlx.
This fine tune was one of the best runs with our data and achieved high F1 score on our eval dataset. (Part of the Nvidia hackathon)
def format_prompt(system_prompt: str, title: str, question: str) -> str:
"Format the question to the format of the dataset we fine-tuned to."
return """<bos><start_of_turn>user
## Instructions
{}
## User
TITLE:
{}
QUESTION:
{}<end_of_turn>
<start_of_turn>model
""".format(
system_prompt, title, question
)
Here's an example of the system_prompt from the dataset:
Read the following title and question about a legal issue and assign the most appropriate tag to it. All tags must be in lowercase, ordered lexicographically and separated by commas.
Loading the model using mlx_lm
from mlx_lm import generate, load
model, tokenizer = load("shellzero/gemma2-2b-ft-law-data-tag-generation")
response = generate(
model,
tokenizer,
prompt=format_prompt(system_prompt, question),
verbose=True, # Set to True to see the prompt and response
temp=0.0,
max_tokens=32,
)
- Downloads last month
- 18
Quantized
Model tree for shellzero/gemma2-2b-ft-law-data-tag-generation
Base model
google/gemma-2-2b