--- license: other base_model: google/gemma-3-270m-it tags: - mlx - finance - gemma - instruction-tuning datasets: - Josephgflowers/Finance-Instruct-500k --- # Gemma-3-270M - Fine-tuned for Financial Instructions This is a fine-tuned version of Google's `gemma-3-270m-it` model, adapted for financial instruction-following tasks. ## Model Description This model was fine-tuned using the Apple MLX framework. The goal was to specialize the base model for financial reporting summary and decision-making assistance. It was trained on the `Josephgflowers/Finance-Instruct-500k` dataset. ## Intended Use This model is intended for tasks related to the financial domain, such as: * Answering questions about financial concepts. * Summarizing financial reports. * Following instructions based on financial data. ## How to Use You can use this model with the `transformers` library just like any other standard Hugging Face model. ```python from transformers import AutoTokenizer, AutoModelForCausalLM model_name = "tlgoa/tmr-ai-nano" tokenizer = AutoTokenizer.from_pretrained(model_name) model = AutoModelForCausalLM.from_pretrained(model_name) # Note: Gemma 3 uses a specific chat template. # For single-turn inference, you can format it like this: prompt = "What is the difference between revenue and profit?" formatted_prompt = f"### User:\n{prompt}\n\n### Assistant:" inputs = tokenizer(formatted_prompt, return_tensors="pt") outputs = model.generate(**inputs, max_new_tokens=200) response = tokenizer.decode(outputs[0], skip_special_tokens=True) # Clean up the response to only show the assistant's part assistant_response = response.split("### Assistant:")[1].strip() print(assistant_response) ``` ## Training Procedure ### Dataset The model was fine-tuned on the `Josephgflowers/Finance-Instruct-500k` dataset. The data was preprocessed to fit the following format: ``` ### User: {user_prompt} ### Assistant: {assistant_response} ``` ### Fine-tuning The model was fine-tuned directly (full parameter tuning) using an Adam optimizer. Due to challenges with LoRA implementation in the available MLX version, a full fine-tuning approach was chosen. The fine-tuned weights were originally saved in MLX's `.npz` format and subsequently converted back to Hugging Face `safetensors` format for distribution. ## Licenses - **Base Model:** This model is based on Google's Gemma-3-270M, which is subject to the [Gemma Terms of Use](https://ai.google.dev/gemma/terms). - **Dataset:** The training data from `Josephgflowers/Finance-Instruct-500k` is available under the Apache 2.0 License.