Edit model card

Uploaded model

  • Developed by: taoki
  • License: apache-2.0
  • Finetuned from model : tokyotech-llm/Swallow-MS-7b-v0.1

Usage

from transformers import AutoTokenizer, AutoModelForCausalLM
import torch

tokenizer = AutoTokenizer.from_pretrained(
  "taoki/Swallow-MS-7b-v0.1-qlora-amenokaku-code"
)
model = AutoModelForCausalLM.from_pretrained(
  "taoki/Swallow-MS-7b-v0.1-qlora-amenokaku-code"
)

if torch.cuda.is_available():
  model = model.to("cuda")

prompt="""### Instruction:
光の三原色は?
### Response:
"""

input_ids = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(
  **input_ids,
  max_new_tokens=512,
  do_sample=True,
  top_p=0.95,
  temperature=0.1,
  repetition_penalty=1.0,
)
print(tokenizer.decode(outputs[0]))

Output

<s>### Instruction:
光の三原色は?
### Response:
 ```python
print('赤')
print('緑')
print('青')
```</s>

This llama model was trained 2x faster with Unsloth and Huggingface's TRL library.

Downloads last month
0
Safetensors
Model size
7.33B params
Tensor type
BF16
·
Inference API
Model is too large to load in Inference API (serverless). To try the model, launch it on Inference Endpoints (dedicated) instead.

Finetuned from

Dataset used to train taoki/Swallow-MS-7b-v0.1-qlora-amenokaku-code