harpertokenConvFT / README.md
harpertoken's picture
Update README.md
0465329 verified
---
license: mit
language:
- en
base_model:
- gpt2
tags:
- text-generation-inference
- conversational-ai
- gpt2
metrics:
- perplexity
- bleu
- f1
library_name: transformers
---
# HarpertokenConvFT
## Model Details
- **Model Name**: HarpertokenConvFT
- **Base Model**: gpt2
- **Model Type**: GPT-2-based conversational AI model
- **Max Sequence Length**: 1024 tokens
## Intended Use
Generates human-like responses for chatbots, virtual assistants, and dialogue systems.
## Training Data
The model was fine-tuned on the DailyDialog dataset, featuring:
- **Training Examples**: 11,118
- **Validation Examples**: 1,000
- **Test Examples**: 1,000
## Dataset Characteristics
- **Description**: A high-quality, multi-turn dialogue dataset covering everyday topics.
- **Features**: Includes dialogues, communication acts, and emotion annotations.
- **Citation**:
```
@InProceedings{li2017dailydialog,
author = {Li, Yanran and Su, Hui and Shen, Xiaoyu and Li, Wenjie and Cao, Ziqiang and Niu, Shuzi},
title = {DailyDialog: A Manually Labelled Multi-turn Dialogue Dataset},
booktitle = {Proceedings of The 8th International Joint Conference on Natural Language Processing (IJCNLP 2017)},
year = {2017}
}
```
## Training Configuration
- **Learning Rate**: 2e-5
- **Batch Size**: 8
- **Number of Epochs**: 3
- **Weight Decay**: 0.01
## Ethical Considerations
Inherited from the GPT-2 base model and the DailyDialog dataset, this model may reflect biases or limitations present in its training data. Caution is advised when using it in sensitive contexts, as it could produce biased or inappropriate responses.
## How to Use
### Using the Model Directly
```python
from transformers import AutoModelForCausalLM, AutoTokenizer
# Load model and tokenizer
model = AutoModelForCausalLM.from_pretrained("harpertoken/harpertokenConvFT")
tokenizer = AutoTokenizer.from_pretrained("harpertoken/harpertokenConvFT")
# Prepare input
input_text = "Hello, how are you?"
inputs = tokenizer(input_text, return_tensors="pt")
# Generate response
outputs = model.generate(**inputs)
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(response)
```
### Using the Terminal
Run the provided script to generate responses:
```bash
python3 generate_response.py --input "Hello, how are you?"
```
### Using the API
**Check API Status:**
```bash
curl http://localhost:8000/status
```
**Generate a Response:**
```bash
curl -X POST http://localhost:8000/chat -H "Content-Type: application/json" -d '{"input_text": "Hello, how are you?"}'
```
### Using FastAPI Documentation
Interact with the API via the browser at:
[http://localhost:8000/docs#/default/generate_response_chat_post](http://localhost:8000/docs#/default/generate_response_chat_post)
## Related Models
- **harpertokenConvAI**: [https://huggingface.co/harpertoken/harpertokenConvAI](https://huggingface.co/harpertoken/harpertokenConvAI) - DistilBERT-based model for question answering. Note: This is not the base model for harpertokenConvFT due to incompatible architectures (DistilBERT vs GPT-2).
- **Base Model**: This model is fine-tuned from GPT-2 ([openai/gpt2](https://huggingface.co/gpt2)).
## Model Differences
harpertokenConvFT is a GPT-2 model for conversational AI, while harpertokenConvAI is a DistilBERT model for question answering. They have different architectures, tokenizers, and parameters, making fine-tuning between them impossible. For truthful info, refer to the config.json files.