Instructions to use novumlogic/nl-slm-distilgpt2-customer-support with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use novumlogic/nl-slm-distilgpt2-customer-support with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="novumlogic/nl-slm-distilgpt2-customer-support")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("novumlogic/nl-slm-distilgpt2-customer-support") model = AutoModelForCausalLM.from_pretrained("novumlogic/nl-slm-distilgpt2-customer-support") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use novumlogic/nl-slm-distilgpt2-customer-support with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "novumlogic/nl-slm-distilgpt2-customer-support" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "novumlogic/nl-slm-distilgpt2-customer-support", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/novumlogic/nl-slm-distilgpt2-customer-support
- SGLang
How to use novumlogic/nl-slm-distilgpt2-customer-support 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 "novumlogic/nl-slm-distilgpt2-customer-support" \ --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": "novumlogic/nl-slm-distilgpt2-customer-support", "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 "novumlogic/nl-slm-distilgpt2-customer-support" \ --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": "novumlogic/nl-slm-distilgpt2-customer-support", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use novumlogic/nl-slm-distilgpt2-customer-support with Docker Model Runner:
docker model run hf.co/novumlogic/nl-slm-distilgpt2-customer-support
SLM for Customer Support Interactions
Description
This model is a fine-tuned version of DistilGPT-2, optimized for customer support interactions. The model has been trained on a dataset consisting of dialogues between customers and support agents to enhance conversational AI performance.π€π¬
- Model type: Transformer-based small language model (SLM)
- Language(s) (NLP): English
- Finetuned from model : DistilGPT-2
Uses
The fine-tuned DistilGPT-2(SLM) is designed to enhance customer support interactions by generating accurate and contextually relevant responses. It can be integrated into customer service chatbots, virtual assistants, and automated helpdesk systems to handle routine inquiries efficiently. By leveraging this model, businesses can improve response times, reduce human agent workload, and ensure consistent communication with customers.
Out-of-Scope Use
β Should not be used for general conversational AI applications unrelated to customer service.
Recommendations
Users should validate outputs before deploying them in live customer support environments and ensure regular updates to align with evolving support needs.
How to Get Started with the Model
Use the code below to get started with the model.
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("novumlogic/nl-slm-distilgpt2-customer-support")
model = AutoModelForCausalLM.from_pretrained("novumlogic/nl-slm-distilgpt2-customer-support")
input_str = "payment options"
# Encode the input string with padding and attention mask
encoded_input = tokenizer.encode_plus(
input_str,
return_tensors='pt',
padding=True,
truncation=True,
max_length=50 # Adjust max_length as needed
)
# Move tensors to the appropriate device
input_ids = encoded_input['input_ids']
attention_mask = encoded_input['attention_mask']
# Set the pad_token_id to the tokenizer's eos_token_id
pad_token_id = tokenizer.eos_token_id
# Generate the output
output = model.generate(
input_ids,
attention_mask=attention_mask,
max_length=400, # Adjust max_length as needed
num_return_sequences=1,
do_sample=True,
top_k=8,
top_p=0.95,
temperature=0.5,
repetition_penalty=1.2,
pad_token_id=pad_token_id
)
# Decode and print the output
decoded_output = tokenizer.decode(output[0], skip_special_tokens=True)
print(decoded_output)
Training Details
Training Data
π Customer Support Interactions Dataset: 26,000 rows (20,800 training, 5,200 validation) (https://huggingface.co/datasets/bitext/Bitext-customer-support-llm-chatbot-training-dataset)
Training Procedure
Preprocessing
π§Ή Data cleaning: Standardizing text and removing noise.
βοΈ Tokenization: Used DistilGPT-2's tokenizer for sequence conversion.
π Formatting: Structuring as "Query | Response" pairs.
Training Hyperparameters
Training regime:
π Batch size: 15
π Epochs: 3
π οΈ Optimizer: Adam with a linear learning rate scheduler
π₯οΈ Training Frameworks: PyTorch, Hugging Face Transformers
Results
| Dataset | ROUGE-1 | ROUGE-2 | ROUGE-L | METEOR | Perplexity |
|---|---|---|---|---|---|
| π Customer Support Interactions | 0.7102 | 0.4586 | 0.5610 | 0.6924 | 1.4273 |
Summary
The Fine-Tuned DistilGPT-2 SLM for Customer Support Interactions is a compact and efficient language model designed to enhance automated customer service. Trained on 26,000 customer-agent dialogues, the model improves chatbot performance by generating accurate, context-aware responses to customer queries.
Glossary
SLM (Small Language Model): A compact language model optimized for efficiency.
Perplexity: Measures how well a model predicts.
ROUGE & METEOR: Metrics for evaluating text generation quality.
Author
Novumlogic Technologies Pvt Ltd
- Downloads last month
- 2
Model tree for novumlogic/nl-slm-distilgpt2-customer-support
Base model
distilbert/distilgpt2