File size: 1,056 Bytes
a65683b efcece3 a65683b efcece3 a65683b efcece3 a65683b efcece3 a65683b efcece3 a65683b efcece3 a65683b |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
---
tags:
- autotrain
- text-generation-inference
- text-generation
- peft
library_name: transformers
base_model: bfuzzy1/acheron-m
widget:
- messages:
- role: user
content: What is 2 + 2 - 3?
license: other
datasets:
- ai2-adapt-dev/gsm8k_math_ifeval_ground_truth_mixed
---
# Usage
```python
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model_path = "bfuzzy1/acheron-m1a-llama"
tokenizer = AutoTokenizer.from_pretrained(model_path)
model = AutoModelForCausalLM.from_pretrained(
model_path,
device_map="auto",
torch_dtype='auto',
trust_remote_code=True
)
messages = [
{"role": "user", "content": "What's 2 + 2 -3?"}
]
input_ids = tokenizer.apply_chat_template(conversation=messages, tokenize=True, add_generation_prompt=True, return_tensors='pt')
output_ids = model.generate(
input_ids.to('mps' if torch.backends.mps.is_available() else 'cpu'),
max_new_tokens=100
)
response = tokenizer.decode(output_ids[0][input_ids.shape[1]:], skip_special_tokens=True)
print(response)
``` |