Instructions to use Locutusque/gpt2-medium-conversational with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Locutusque/gpt2-medium-conversational with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Locutusque/gpt2-medium-conversational")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Locutusque/gpt2-medium-conversational") model = AutoModelForCausalLM.from_pretrained("Locutusque/gpt2-medium-conversational", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Locutusque/gpt2-medium-conversational with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Locutusque/gpt2-medium-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-medium-conversational", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Locutusque/gpt2-medium-conversational
- SGLang
How to use Locutusque/gpt2-medium-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-medium-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-medium-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-medium-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-medium-conversational", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Locutusque/gpt2-medium-conversational with Docker Model Runner:
docker model run hf.co/Locutusque/gpt2-medium-conversational
Commit ·
853ceb9
1
Parent(s): 3398fd6
Update README.md
Browse files
README.md
CHANGED
|
@@ -18,6 +18,7 @@ pipeline_tag: text-generation
|
|
| 18 |
- Model Name: gpt2-medium-conversational (prototype)
|
| 19 |
- Model Type: Language Modeling
|
| 20 |
- Task: Generating Conversational Responses
|
|
|
|
| 21 |
- Description: This model is trained on a dataset of conversations between a user and an AI assistant, with the goal of generating a coherent and relevant response to the user's input. It uses the GPT-2 architecture, a state-of-the-art transformer-based language model that is capable of generating high-quality text with a wide range of styles and tones. The model is fine-tuned on the conversational data using maximum likelihood estimation, and is evaluated based on its ability to generate responses that are both grammatically correct and semantically relevant to the user's input.
|
| 22 |
- Unfortunately, this is not the full model. The full model had much better performance but no longer exists due to a data loss incident.
|
| 23 |
## Intended Use
|
|
|
|
| 18 |
- Model Name: gpt2-medium-conversational (prototype)
|
| 19 |
- Model Type: Language Modeling
|
| 20 |
- Task: Generating Conversational Responses
|
| 21 |
+
- Hardware: 1x RTX 3060
|
| 22 |
- Description: This model is trained on a dataset of conversations between a user and an AI assistant, with the goal of generating a coherent and relevant response to the user's input. It uses the GPT-2 architecture, a state-of-the-art transformer-based language model that is capable of generating high-quality text with a wide range of styles and tones. The model is fine-tuned on the conversational data using maximum likelihood estimation, and is evaluated based on its ability to generate responses that are both grammatically correct and semantically relevant to the user's input.
|
| 23 |
- Unfortunately, this is not the full model. The full model had much better performance but no longer exists due to a data loss incident.
|
| 24 |
## Intended Use
|