Model Card for Model ID

Training dataset

  • data_set : nayohan/CodeFeedback-Filtered-Instruction-ko
    • ํ•ด๋‹น ๋ฐ์ดํ„ฐ์…‹์„ ์ „๋ถ€ ์‚ฌ์šฉํ•œ๊ฑด ์•„๋‹ˆ๋ฉฐ Python์–ธ์–ด๋ฅผ ์šฐ์„  ์ถ”์ถœํ•œ๋‹ค์Œ ๋ฐ์ดํ„ฐ์…‹๋“ค์˜ ์ƒ๊น€์ƒˆ๋ฅผ ํŒŒ์•…, ๊ทธ ๋‹ค์Œ ์ „์ฒ˜๋ฆฌ๊ฐ€ ๊ณตํ†ต์ ์œผ๋กœ ๋“ค์–ด๊ฐˆ๋งŒํ•œ ๋ฐ์ดํ„ฐ๋ฅผ ๋‹ค์‹œ ์ถ”์ถœํ•˜์—ฌ ํ•™์Šต์— ์‚ฌ์šฉํ–ˆ์Šต๋‹ˆ๋‹ค.
      • ์ด ํ•™์Šต ๋ฐ์ดํ„ฐ ๊ฑด : 49,859 ๊ฑด

Basic usage

from transformers import AutoTokenizer, AutoModelForCausalLM
import torch

model_id = 'MDDDDR/Llama-3.2-1B-Instruct-FFT-coder-python'
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id,
                                             device_map="cuda:0",
                                             torch_dtype=torch.bfloat16)


instruction = '''LCS(Longest Common Subsequence, ์ตœ์žฅ ๊ณตํ†ต ๋ถ€๋ถ„ ์ˆ˜์—ด)๋ฌธ์ œ๋Š” ๋‘ ์ˆ˜์—ด์ด ์ฃผ์–ด์กŒ์„ ๋•Œ, ๋ชจ๋‘์˜ ๋ถ€๋ถ„ ์ˆ˜์—ด์ด ๋˜๋Š” ์ˆ˜์—ด ์ค‘ ๊ฐ€์žฅ ๊ธด ๊ฒƒ์„ ์ฐพ๋Š” ๋ฌธ์ œ์ด๋‹ค.

์˜ˆ๋ฅผ ๋“ค์–ด, ACAYKP์™€ CAPCAK์˜ LCS๋Š” ACAK๊ฐ€ ๋œ๋‹ค.

###์ž…๋ ฅ : ์ฒซ์งธ ์ค„๊ณผ ๋‘˜์งธ ์ค„์— ๋‘ ๋ฌธ์ž์—ด์ด ์ฃผ์–ด์ง„๋‹ค. ๋ฌธ์ž์—ด์€ ์•ŒํŒŒ๋ฒณ ๋Œ€๋ฌธ์ž๋กœ๋งŒ ์ด๋ฃจ์–ด์ ธ ์žˆ์œผ๋ฉฐ, ์ตœ๋Œ€ 1000๊ธ€์ž๋กœ ์ด๋ฃจ์–ด์ ธ ์žˆ๋‹ค.
###์ถœ๋ ฅ : ์ฒซ์งธ ์ค„์— ์ž…๋ ฅ์œผ๋กœ ์ฃผ์–ด์ง„ ๋‘ ๋ฌธ์ž์—ด์˜ LCS์˜ ๊ธธ์ด๋ฅผ ์ถœ๋ ฅํ•œ๋‹ค.

###์ž…๋ ฅ ์˜ˆ์ œ : 
ACAYKP
CAPCAK
###์ถœ๋ ฅ ์˜ˆ์ œ : 4
'''

messages = [
    {
        "role":"user",
        "content":"์•„๋ž˜๋Š” ๋ฌธ์ œ๋ฅผ ์„ค๋ช…ํ•˜๋Š” ์ง€์‹œ์‚ฌํ•ญ์ž…๋‹ˆ๋‹ค. ์ด ์š”์ฒญ์— ๋Œ€ํ•ด ์ ์ ˆํ•˜๊ฒŒ ๋‹ต๋ณ€ํ•ด์ฃผ์„ธ์š”.\n###์ง€์‹œ์‚ฌํ•ญ:{instruction}\n###๋‹ต๋ณ€:".format(instruction=instruction)
    }
]

with torch.no_grad():
  prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=False)
  inputs = tokenizer(prompt, return_tensors="pt", padding=False).to('cuda')
  outputs = model.generate(**inputs, 
                           use_cache=False, 
                           max_length=256, 
                           top_p=0.9,
                           temperature=0.7, 
                           repetition_penalty=1.0,
                           pad_token_id=tokenizer.pad_token_id)

output_text = tokenizer.decode(outputs[0], skip_special_tokens=True)
final_output = output_text.split('๋‹ต๋ณ€:')[-1].strip()
print(final_output)
# ```python
# def longest_common_subsequence(str1, str2):
#     m = len(str1)
#     n = len(str2)
#     dp = [[0] * (n+1) for _ in range(m+1)]
#     
#     for i in range(m+1):
#         for j in range(n+1):
#             if i == 0 or j == 0:
#                 dp[i][j] = 0
#             elif str1[i-1] == str2[j-1]:
#                 dp[i][j] = dp[i-1][j-1] + 1
#             else:
#                 dp[i][j] = max(dp[i-1][j], dp[i][j-1])
#     
#     return dp[m][n]
# 
# print(longest_common_subsequence("ACAYKP", "CAPCAK"))  # Output: 4
# ```

Hardware

  • A100 40GB x 1
  • Training Time : 1 hour 45 minutes
Downloads last month
20
Safetensors
Model size
1.24B params
Tensor type
BF16
ยท
Inference Providers NEW
This model is not currently available via any of the supported third-party Inference Providers, and the model is not deployed on the HF Inference API.

Model tree for MDDDDR/Llama-3.2-1B-Instruct-FFT-coder-python

Finetuned
(274)
this model

Dataset used to train MDDDDR/Llama-3.2-1B-Instruct-FFT-coder-python

Collection including MDDDDR/Llama-3.2-1B-Instruct-FFT-coder-python