Run this model with HF Jobs

Run mhenrichsen/danskgpt-tiny-chat 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/mhenrichsen/danskgpt-tiny-chat. 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/mhenrichsen/danskgpt-tiny-chat 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/mhenrichsen/danskgpt-tiny-chat. 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/mhenrichsen/danskgpt-tiny-chat. 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.

DanskGPT-tiny-chat

DanskGPT-tiny-chat er chat-varianten af mhenrichsen/danskgpt-tiny trænet på private chat datasæt.

Model beskrivelse

Modellen er beregnet til at være en lightweight version af DanskGPT, der kan køre på næsten alle enheder.

Prompt template

Modellen er trænet med ChatML format (samme som OpenAI's modeller), og skal bruges på følgende måde:

<|im_start|>system\nDu er en hjælpsom assistent.<|im_end|>\n<|im_start|>user\nHvad er skak?<|im_end|>\n<|im_start|>assistant

Inferens

Ollama

Installér ollama: https://ollama.ai/download

Kør:

ollama run mhenrichsen/danskgpt-tiny-chat

vLLM

pip install vllm
from vllm import LLM, SamplingParams

sampling_params = SamplingParams(temperature=0.8, top_p=0.95, max_tokens=1024)
llm = LLM(model="mhenrichsen/danskgpt-tiny-chat")

system_message = "Du er en hjælpsom assistent."
conversation_history = f"<|im_start|>system\n{system_message}<|im_end|>\n<|im_start|>user\n"
while True:
    prompt = input("Bruger: ")
    new_prompt = f"{conversation_history}{prompt}<|im_end|>\n<|im_start|>assistant\n"

    outputs = llm.generate(new_prompt, sampling_params)
    for output in outputs:
        prompt = output.prompt
        generated_text = output.outputs[0].text
        print(f"AI: {generated_text!r}")
        conversation_history = f"{prompt}{generated_text!r}<|im_end|>\n<|im_start|>user\n"

Endpoint med openai

pip install openai
python -m vllm.entrypoints.openai.api_server --model mhenrichsen/danskgpt-tiny-chat

og brugt som erstatning for OpenAI's endpoints:

from openai import OpenAI
openai_api_key = "EMPTY"
openai_api_base = "http://localhost:8000/v1"

client = OpenAI(
    api_key=openai_api_key,
    base_url=openai_api_base,
)

chat_response = client.chat.completions.create(
    model="mhenrichsen/danskgpt-tiny-chat",
    messages=[
        {"role": "system", "content": "Du er en hjælpsom assistent. Giv mig et langt svar."},
        {"role": "user", "content": "Fortæl mig om Danmark."},
    ]
)
print("AI:", chat_response)

Training results

Training Loss Epoch Step Validation Loss
1.3599 0.0 1 1.4118
0.7896 0.25 136 0.7813
0.7339 0.5 272 0.7490
0.7378 0.75 408 0.7285
0.7112 1.0 544 0.7146
0.6377 1.23 680 0.7135
0.6192 1.49 816 0.7133
0.5985 1.74 952 0.7073
0.6067 1.99 1088 0.7026
0.5139 2.22 1224 0.7167
0.5099 2.47 1360 0.7193
0.5217 2.72 1496 0.7168

Brug for hjælp?

Har du spørgsmål eller brug for hjælp til LLM'er eller automatisering af tekstbaserede opgaver, så kontakt mig gerne.

/Mads

Downloads last month
166
Safetensors
Model size
1B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for mhenrichsen/danskgpt-tiny-chat

Finetuned
(1)
this model
Quantizations
1 model