community-datasets/hrwac
Updated • 192
How to use domsebalj/GPcroaT with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="domsebalj/GPcroaT") # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("domsebalj/GPcroaT")
model = AutoModelForCausalLM.from_pretrained("domsebalj/GPcroaT")How to use domsebalj/GPcroaT with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "domsebalj/GPcroaT"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "domsebalj/GPcroaT",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/domsebalj/GPcroaT
How to use domsebalj/GPcroaT with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "domsebalj/GPcroaT" \
--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": "domsebalj/GPcroaT",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'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 "domsebalj/GPcroaT" \
--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": "domsebalj/GPcroaT",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use domsebalj/GPcroaT with Docker Model Runner:
docker model run hf.co/domsebalj/GPcroaT
If you use this model for own tasks, please share your results in the community tab.
With Tensorflow you can use:
from transformers import GPT2Tokenizer, TFGPT2Model
tokenizer = GPT2Tokenizer.from_pretrained("domsebalj/GPcroaT")
model = TFGPT2LMHeadModel.from_pretrained("domsebalj/GPcroaT")
text = "Zamijeni ovaj tekst vlastitim"
input_ids = tokenizer.encode(text, return_tensors='tf')
beam_output = model.generate(
input_ids,
max_length = 80,
min_length = 10,
num_beams = 10,
temperature = 5.7,
no_repeat_ngram_size=2,
num_return_sequences=5,
repetition_penalty =7.5,
length_penalty = 1.5,
top_k = 50
)
output = []
for i in beam_output:
output.append(tokenizer.decode(i))
print(output)