ddobokki / gpt2_poem

huggingface.co
Total runs: 28
24-hour runs: 0
7-day runs: 0
30-day runs: 0
Model's Last Updated: August 31 2023
text-generation

Introduction of gpt2_poem

Model Details of gpt2_poem

import torch
from transformers import AutoTokenizer, AutoModelForCausalLM

# device setting
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
# load model and tokenizer
model_name_or_path = "ddobokki/gpt2_poem"

tokenizer = AutoTokenizer.from_pretrained(model_name_or_path)
model = AutoModelForCausalLM.from_pretrained(model_name_or_path)
model.to(device)

keyword_start_token = "<k>"
keyword_end_token = "</k>"
text = "산 꼭대기가 보이는 경치"
input_text = keyword_start_token + text + keyword_end_token

input_ids = tokenizer.encode(input_text, return_tensors="pt").to(device)
gen_ids = model.generate(
    input_ids, max_length=64, num_beams=100, no_repeat_ngram_size=2
)
generated = tokenizer.decode(gen_ids[0, :].tolist(), skip_special_tokens=True)
>> 오르락내리락
산 꼭대기를 올려다보니
아득히 멀고 아득한
나뭇가지에 매달린
작은 산새 한 마리
이름 모를 풀 한포기 안고
어디론가 훌쩍 떠나가 버렸다

Runs of ddobokki gpt2_poem on huggingface.co

28
Total runs
0
24-hour runs
0
3-day runs
0
7-day runs
0
30-day runs

More Information About gpt2_poem huggingface.co Model

gpt2_poem huggingface.co

gpt2_poem huggingface.co is an AI model on huggingface.co that provides gpt2_poem's model effect (), which can be used instantly with this ddobokki gpt2_poem model. huggingface.co supports a free trial of the gpt2_poem model, and also provides paid use of the gpt2_poem. Support call gpt2_poem model through api, including Node.js, Python, http.

ddobokki gpt2_poem online free

gpt2_poem huggingface.co is an online trial and call api platform, which integrates gpt2_poem's modeling effects, including api services, and provides a free online trial of gpt2_poem, you can try gpt2_poem online for free by clicking the link below.

ddobokki gpt2_poem online free url in huggingface.co:

https://huggingface.co/ddobokki/gpt2_poem

gpt2_poem install

gpt2_poem is an open source model from GitHub that offers a free installation service, and any user can find gpt2_poem on GitHub to install. At the same time, huggingface.co provides the effect of gpt2_poem install, users can directly use gpt2_poem installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

gpt2_poem install url in huggingface.co:

https://huggingface.co/ddobokki/gpt2_poem

Url of gpt2_poem

gpt2_poem huggingface.co Url

Provider of gpt2_poem huggingface.co

ddobokki
ORGANIZATIONS

Other API from ddobokki

huggingface.co

Total runs: 1.1K
Run Growth: -686
Growth Rate: -59.86%
Updated:October 22 2024