Instructions to use Locutusque/gpt2-large-conversational with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Locutusque/gpt2-large-conversational with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Locutusque/gpt2-large-conversational")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Locutusque/gpt2-large-conversational") model = AutoModelForCausalLM.from_pretrained("Locutusque/gpt2-large-conversational", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Locutusque/gpt2-large-conversational with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Locutusque/gpt2-large-conversational" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Locutusque/gpt2-large-conversational", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Locutusque/gpt2-large-conversational
- SGLang
How to use Locutusque/gpt2-large-conversational 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 "Locutusque/gpt2-large-conversational" \ --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": "Locutusque/gpt2-large-conversational", "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 "Locutusque/gpt2-large-conversational" \ --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": "Locutusque/gpt2-large-conversational", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Locutusque/gpt2-large-conversational with Docker Model Runner:
docker model run hf.co/Locutusque/gpt2-large-conversational
Commit ·
d30000f
1
Parent(s): 3fbbc7a
Update README.md
Browse files
README.md
CHANGED
|
@@ -35,7 +35,7 @@ The model is evaluated based on several metrics, including loss, reward, penalty
|
|
| 35 |
- loss: 3.1
|
| 36 |
|
| 37 |
## Limitations and Bias
|
| 38 |
-
This model is not suitable for all use cases due to its limited training time on a weak computer. As a result, it may produce irrelevant or nonsensical responses. Additionally, it has not been fine-tuned to remember the chat history, is unable to provide follow-up responses, and it does not know the answer to many questions (it was only fine-tuned to respond in a conversational way). For optimal performance,
|
| 39 |
|
| 40 |
```python
|
| 41 |
import torch
|
|
|
|
| 35 |
- loss: 3.1
|
| 36 |
|
| 37 |
## Limitations and Bias
|
| 38 |
+
This model is not suitable for all use cases due to its limited training time on a weak computer. As a result, it may produce irrelevant or nonsensical responses. Additionally, it has not been fine-tuned to remember the chat history, is unable to provide follow-up responses, and it does not know the answer to many questions (it was only fine-tuned to respond in a conversational way). For optimal performance, I recommend using a GPU with at least 12 GB of VRAM and downloading the model manually instead of using the Transformers library. Here's how you should deploy the model:
|
| 39 |
|
| 40 |
```python
|
| 41 |
import torch
|