Run this model with HF Jobs

Run svjack/prompt-extend-chinese-gpt 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/svjack/prompt-extend-chinese-gpt. 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/svjack/prompt-extend-chinese-gpt 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/svjack/prompt-extend-chinese-gpt. 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/svjack/prompt-extend-chinese-gpt. 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.
from transformers import BertTokenizer, GPT2LMHeadModel
device = "cpu"

model_path = "svjack/prompt-extend-chinese-gpt"
tokenizer = BertTokenizer.from_pretrained(model_path)
model = GPT2LMHeadModel.from_pretrained(model_path)

prompt = "一只凶猛的老虎,咬死了一只豺狼。"

encode = tokenizer(prompt, return_tensors='pt').to(device)
answer = model.generate(encode.input_ids,
                       max_length = 128,
    num_beams=2,
    top_p = 0.95,
    top_k = 50,
    repetition_penalty = 2.5,
    length_penalty=1.0,
    early_stopping=True,
                       )[0]
decoded = tokenizer.decode(answer, skip_special_tokens=True)
decoded

'一 只 凶 猛 的 老 虎 , 咬 死 了 一 只 豺 狼 。 高 度 详 细 , 数 字 绘 画 , 艺 术 站 , 概 念 艺 术 , 锐 利 的 焦 点 , 插 图 , 电 影 照 明 , 艺 术 由 artgerm 和 greg rutkowski 和 alphonse mucha 8 k 彩 色 辛 烷 渲 染 。'
Downloads last month
39
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Spaces using svjack/prompt-extend-chinese-gpt 2