|
|
--- |
|
|
license: mit |
|
|
tags: |
|
|
- causal_lm |
|
|
- generated_from_trainer |
|
|
base_model: broadfield-dev/gemma-3-270m-tuned-0105-1022-tuned-0105-1045-tuned-0105-1111-tuned-0105-1133 |
|
|
datasets: |
|
|
- broadfield-dev/deepmind_narrativeqa-Broadfield |
|
|
model-index: |
|
|
- name: gemma-3-270m-tuned-0105-1022-tuned-0105-1045-tuned-0105-1111-tuned-0105-1133-tuned-0105-1735 |
|
|
results: [] |
|
|
--- |
|
|
# broadfield-dev/gemma-3-270m-context-qa |
|
|
This model is a fine-tuned version of [broadfield-dev/gemma-3-270m-tuned-0105-1022-tuned-0105-1045-tuned-0105-1111-tuned-0105-1133](https://huggingface.co/broadfield-dev/gemma-3-270m-tuned-0105-1022-tuned-0105-1045-tuned-0105-1111-tuned-0105-1133) on the [broadfield-dev/deepmind_narrativeqa-Broadfield](https://huggingface.co/broadfield-dev/deepmind_narrativeqa-Broadfield) dataset. |
|
|
## Training Details |
|
|
- **Task:** CAUSAL_LM |
|
|
- **Epochs:** 1 |
|
|
- **Learning Rate:** 2e-05 |
|
|
- **Gradient Accumulation Steps:** 4 |
|
|
|
|
|
## Entity Labels |
|
|
`['LABEL_0', 'LABEL_1']` |
|
|
|
|
|
## Usage |
|
|
```python |
|
|
from transformers import AutoTokenizer, AutoModelForCausalLM |
|
|
import torch |
|
|
model_id = "broadfield-dev/gemma-3-270m-context-qa" |
|
|
tokenizer = AutoTokenizer.from_pretrained(model_id) |
|
|
model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype=torch.float16) |
|
|
messages = [ |
|
|
{"role": "system", "content": "Using the context, answer the users question."}, |
|
|
{"role": "user", "content": "Context: {context_content}\n\nQuestion: Your input here..."} |
|
|
|
|
|
] |
|
|
inputs = tokenizer.apply_chat_template(messages, return_tensors="pt", add_generation_prompt=True).to(model.device) |
|
|
outputs = model.generate(inputs, max_new_tokens=256) |
|
|
print(tokenizer.decode(outputs[0], skip_special_tokens=True)) |
|
|
``` |
|
|
|