lizziepika/strava_activities_runs
Viewer • Updated • 59 • 18 • 1
How to use Lukamac/PlayPart-AI-Personal-Trainer with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="Lukamac/PlayPart-AI-Personal-Trainer") # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("Lukamac/PlayPart-AI-Personal-Trainer")
model = AutoModelForCausalLM.from_pretrained("Lukamac/PlayPart-AI-Personal-Trainer")How to use Lukamac/PlayPart-AI-Personal-Trainer with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "Lukamac/PlayPart-AI-Personal-Trainer"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "Lukamac/PlayPart-AI-Personal-Trainer",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/Lukamac/PlayPart-AI-Personal-Trainer
How to use Lukamac/PlayPart-AI-Personal-Trainer with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "Lukamac/PlayPart-AI-Personal-Trainer" \
--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": "Lukamac/PlayPart-AI-Personal-Trainer",
"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 "Lukamac/PlayPart-AI-Personal-Trainer" \
--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": "Lukamac/PlayPart-AI-Personal-Trainer",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use Lukamac/PlayPart-AI-Personal-Trainer with Docker Model Runner:
docker model run hf.co/Lukamac/PlayPart-AI-Personal-Trainer
This model is a fine-tuned version of GPT-2, specifically trained on sports-related and gym exercise datasets. It is intended to provide text-generation capabilities for answering questions about fitness, sports, workout routines, and providing personalized training suggestions.
To use the model, you can either use the Hugging Face Inference API or load it in your Python environment.
from transformers import GPT2Tokenizer, GPT2LMHeadModel
# Load the model
tokenizer = GPT2Tokenizer.from_pretrained("Lukamac/PlayPart-AI-Personal-Trainer")
model = GPT2LMHeadModel.from_pretrained("Lukamac/PlayPart-AI-Personal-Trainer")
# Generate a response
input_text = "What are the best exercises for building upper body strength?"
input_ids = tokenizer.encode(input_text, return_tensors='pt')
output_ids = model.generate(input_ids, max_length=50)
response = tokenizer.decode(output_ids[0], skip_special_tokens=True)
print(response)