Run this model with HF Jobs

Run etri-xainlp/polyglot-ko-12.8b-instruct on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs and TRL to fine-tune https://huggingface.co/etri-xainlp/polyglot-ko-12.8b-instruct. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/etri-xainlp/polyglot-ko-12.8b-instruct on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.

Evaluate on a benchmark

Use HF Jobs to evaluate https://huggingface.co/etri-xainlp/polyglot-ko-12.8b-instruct. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.

Quantize for lower memory use

Use HF Jobs to create a 4-bit version of https://huggingface.co/etri-xainlp/polyglot-ko-12.8b-instruct. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.

polyglot-ko-12.8b-instruct

This model is a fine-tuned version of EleutherAI/polyglot-ko-12.8b on an instruction-following dataset(260k).

Training procedure

Training hyperparameters

The following hyperparameters were used during training:

  • learning_rate: 5e-05
  • train_batch_size: 1
  • seed: 42
  • distributed_type: multi-GPU(A100 80G)
  • num_devices: 8
  • gradient_accumulation_steps: 64
  • total_train_batch_size: 512
  • total_eval_batch_size: 64
  • optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
  • lr_scheduler_type: linear
  • num_epochs: 5.0

Inference

import torch
from transformers import pipeline, AutoModelForCausalLM

MODEL = 'etri-xainlp/polyglot-ko-12.8b-instruct'

model = AutoModelForCausalLM.from_pretrained(
    MODEL,
    torch_dtype=torch.float16,
    low_cpu_mem_usage=True,
).to(device=f"cuda", non_blocking=True)
model.eval()

pipe = pipeline(
    'text-generation', 
    model=model,
    tokenizer=MODEL,
    device=0
)
pipe.model.config.pad_token_id = pipe.model.config.eos_token_id

def ask(x, context='', is_input_full=False):
    ans = pipe(
        f"### ์งˆ๋ฌธ: {x}\n\n### ๋งฅ๋ฝ: {context}\n\n### ๋‹ต๋ณ€:" if context else f"### ์งˆ๋ฌธ: {x}\n\n### ๋‹ต๋ณ€:", 
        do_sample=True, 
        max_new_tokens=2048,
        temperature=0.9,
        top_p=0.9,
        return_full_text=False,
        eos_token_id=2,
    )
    return ans[0]['generated_text']

while True:
    quit = input('prompt?: ')
    if quit == 'q':
        break
    else:
        generation = ask(quit)
        print("etri_ai:", generation)

Framework versions

  • Transformers 4.30.2
  • Pytorch 2.0.1+cu118
  • Datasets 2.13.1
  • Tokenizers 0.13.3
Downloads last month
69
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Space using etri-xainlp/polyglot-ko-12.8b-instruct 1