Text Generation
Transformers
PyTorch
TensorBoard
gpt2
Generated from Trainer
text-generation-inference
Instructions to use tvergho/highlight_model with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use tvergho/highlight_model with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="tvergho/highlight_model")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("tvergho/highlight_model") model = AutoModelForCausalLM.from_pretrained("tvergho/highlight_model", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use tvergho/highlight_model with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "tvergho/highlight_model" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "tvergho/highlight_model", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/tvergho/highlight_model
- SGLang
How to use tvergho/highlight_model 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 "tvergho/highlight_model" \ --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": "tvergho/highlight_model", "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 "tvergho/highlight_model" \ --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": "tvergho/highlight_model", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use tvergho/highlight_model with Docker Model Runner:
docker model run hf.co/tvergho/highlight_model
Model save
Browse filesFiles changed (7)
- config.json+7-5
- pytorch_model.bin+2-2
- runs/Jan29_20-55-48_5e46bb2b8a6f/1675025781.431266/events.out.tfevents.1675025781.5e46bb2b8a6f.327.1Added+3
- runs/Jan29_20-55-48_5e46bb2b8a6f/events.out.tfevents.1675025781.5e46bb2b8a6f.327.0Added+3
- runs/Jan29_20-55-48_5e46bb2b8a6f/events.out.tfevents.1675028637.5e46bb2b8a6f.327.2Added+3
- tokenizer_config.json+1-1
- training_args.bin+2-2
123456 unmodified lines12131415161718192021222311 unmodified lines35363738394041{"_name_or_path": "gpt2","activation_function": "gelu_new","architectures": ["GPT2LMHeadModel"6 unmodified lines"layer_norm_epsilon": 1e-05,"model_type": "gpt2","n_ctx": 1024,"n_embd": 768,"n_head": 12,"n_inner": null,"n_layer": 12,"n_positions": 1024,"pad_token_id": 50260,"reorder_and_upcast_attn": false,"resid_pdrop": 0.1,"scale_attn_by_inverse_layer_idx": false,11 unmodified lines}},"torch_dtype": "float32","transformers_version": "4.26.0","use_cache": true,"vocab_size": 50262}123456 unmodified lines121314151617181920212223242511 unmodified lines37383940414243{"_name_or_path": "gpt2-medium","activation_function": "gelu_new","architectures": ["GPT2LMHeadModel"6 unmodified lines"layer_norm_epsilon": 1e-05,"model_type": "gpt2","n_ctx": 1024,"n_embd": 1024,"n_head": 16,"n_inner": null,"n_layer": 24,"n_positions": 1024,"n_special": 0,"pad_token_id": 50260,"predict_special_tokens": true,"reorder_and_upcast_attn": false,"resid_pdrop": 0.1,"scale_attn_by_inverse_layer_idx": false,11 unmodified lines}},"torch_dtype": "float32","transformers_version": "4.20.1","use_cache": true,"vocab_size": 50262}
123version https://git-lfs.github.com/spec/v1oid sha256:b871b6340c6da1c87856201bcacb464ac48d77cd1ef872647d42723910624f96size 510413373123version https://git-lfs.github.com/spec/v1oid sha256:56b3f664c2d2a0be6c23106e2eba9688dd34421e10b8716fffdd0ebad8fbda65size 1444587353
123version https://git-lfs.github.com/spec/v1oid sha256:29a01ae147d3ce56da839990e142de9ed4ad707b5194696c8a469428af4f44bdsize 5337123version https://git-lfs.github.com/spec/v1oid sha256:da473714d034231a81149fa21285f9ed55f5fd9fac80a7a042bd07e3992d2b64size 5375123version https://git-lfs.github.com/spec/v1oid sha256:983b379b751db52098d39f744dffacbdf55207fde3cffee64752e90ade9dc673size 3062 unmodified lines34567892 unmodified lines"bos_token": "<|endoftext|>","eos_token": "<|endoftext|>","model_max_length": 1024,"name_or_path": "gpt2","special_tokens_map_file": null,"tokenizer_class": "GPT2Tokenizer","unk_token": "<|endoftext|>"2 unmodified lines34567892 unmodified lines"bos_token": "<|endoftext|>","eos_token": "<|endoftext|>","model_max_length": 1024,"name_or_path": "gpt2-medium","special_tokens_map_file": null,"tokenizer_class": "GPT2Tokenizer","unk_token": "<|endoftext|>"
123version https://git-lfs.github.com/spec/v1oid sha256:4178542ac5e13e0eeffce5bb1ffdec0735fdf919d0fe05b2b98a5a6f73de28easize 3515123version https://git-lfs.github.com/spec/v1oid sha256:7fb6c82bcb8363c00b89eec2cc483a93427a4f2365092d03c06b86781ea88711size 3311
config.json+7-5
pytorch_model.bin+2-2
runs/Jan29_20-55-48_5e46bb2b8a6f/1675025781.431266/events.out.tfevents.1675025781.5e46bb2b8a6f.327.1Added+3
runs/Jan29_20-55-48_5e46bb2b8a6f/events.out.tfevents.1675025781.5e46bb2b8a6f.327.0Added+3
runs/Jan29_20-55-48_5e46bb2b8a6f/events.out.tfevents.1675028637.5e46bb2b8a6f.327.2Added+3
tokenizer_config.json+1-1
training_args.bin+2-2