Instructions to use jinymusim/gpt-czech-poet-unicode with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use jinymusim/gpt-czech-poet-unicode with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="jinymusim/gpt-czech-poet-unicode")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("jinymusim/gpt-czech-poet-unicode") model = AutoModelForCausalLM.from_pretrained("jinymusim/gpt-czech-poet-unicode") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use jinymusim/gpt-czech-poet-unicode with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "jinymusim/gpt-czech-poet-unicode" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "jinymusim/gpt-czech-poet-unicode", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/jinymusim/gpt-czech-poet-unicode
- SGLang
How to use jinymusim/gpt-czech-poet-unicode with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "jinymusim/gpt-czech-poet-unicode" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "jinymusim/gpt-czech-poet-unicode", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "jinymusim/gpt-czech-poet-unicode" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "jinymusim/gpt-czech-poet-unicode", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use jinymusim/gpt-czech-poet-unicode with Docker Model Runner:
docker model run hf.co/jinymusim/gpt-czech-poet-unicode
Czech Poetry GPT
GPT2 finetuned on Czech poetry from github project by
Institute of Czech Literature, Czech Academy of Sciences.
https://github.com/versotym/corpusCzechVerse
Usage
Use as any other GPT2 style model
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
tokenizer = AutoTokenizer.from_pretrained("jinymusim/gpt-czech-poet-unicode")
model = AutoModelForCausalLM.from_pretrained("jinymusim/gpt-czech-poet-unicode")
# Input Poet Start
poet_start = "# AABB # 1900\nD"
poet_start = poet_start.strip()
tokenized_poet_start = tokenizer.encode(poet_start, return_tensors='pt')
# generated a continuation to it
out = model.generate(tokenized_poet_start,
max_length=256,
do_sample=True,
top_k=50
early_stopping=True,
pad_token_id= tokenizer.pad_token_id,
eos_token_id = tokenizer.eos_token_id)
# Decode Poet
decoded_cont = tokenizer.decode(out[0], skip_special_tokens=True)
print(decoded_cont)
- Downloads last month
- 2