Instructions to use Deeokay/gpt2-javis-stks with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Deeokay/gpt2-javis-stks with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Deeokay/gpt2-javis-stks")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Deeokay/gpt2-javis-stks") model = AutoModelForCausalLM.from_pretrained("Deeokay/gpt2-javis-stks") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Deeokay/gpt2-javis-stks with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Deeokay/gpt2-javis-stks" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Deeokay/gpt2-javis-stks", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Deeokay/gpt2-javis-stks
- SGLang
How to use Deeokay/gpt2-javis-stks 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 "Deeokay/gpt2-javis-stks" \ --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": "Deeokay/gpt2-javis-stks", "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 "Deeokay/gpt2-javis-stks" \ --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": "Deeokay/gpt2-javis-stks", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Deeokay/gpt2-javis-stks with Docker Model Runner:
docker model run hf.co/Deeokay/gpt2-javis-stks
Model Card for Model ID
Fine tuning (learning/educational) results of GPT2-medium on a customized dataset
Testing different ways to provide a though process withing GPT2
This one seemed like the best results for now..
Model Details
Base model : 'hf_models/gpt2-medium'
Direct Use
from transformers import GPT2LMHeadModel, GPT2Tokenizer
models_folder = "Deeokay/gpt2-javis-stks"
# if you know your device, you can just set "device = 'mps'"
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
model = GPT2LMHeadModel.from_pretrained(models_folder)
tokenizer = GPT2Tokenizer.from_pretrained(models_folder)
tokenizer.pad_token = tokenizer.eos_token
prompt = "what is the meaning of life?"
inputs = tokenizer(prompt, return_tensors="pt", padding=True, truncation=True).to(device)
set_seed(42)
sample_output = model.generate(
**inputs,
max_new_tokens=250,
do_sample=True,
top_k=30,
temperature=0.7,
)
print("Output:\n" + 80 * '-')
print(tokenizer.decode(sample_output[0], skip_special_tokens=True))
[More Information Needed]
Training Details
Training Data
[More Information Needed]
Training Procedure
Evaluation
Summary
- Downloads last month
- 8