Downloads · 30 days
13
29% of all-time downloads
hoangkha1810/bart-mathematics
bart-mathematics is a machine learning model from hoangkha1810. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as llama2.
This project trains a chatbot using the facebook/bart-large-cnn model from Hugging Face's Transformers library. The chatbot is trained on a dataset of question-answer pairs and is capable of generating responses to us…
Downloads · 30 days
13
29% of all-time downloads
All-time downloads
45
Public
Parameters
406M
1.6 GB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors1.6 GB · 100%
From the Hugging Face model README
This project trains a chatbot using the facebook/bart-large-cnn model from Hugging Face's Transformers library. The chatbot is trained on a dataset of question-answer pairs and is capable of generating responses to user queries.
Ensure you have the following libraries installed before running the script:
pip install transformers datasets torch
The chatbot is trained on a CSV dataset (dataset.csv) containing two columns:
question: The input question.answer: The corresponding answer.The dataset is loaded using the Hugging Face datasets library.
Tokenization:
AutoTokenizer to process text.Data Splitting:
Training Configuration:
Trainer API for fine-tuning.Model Saving:
./saved_model.After training, you can generate responses using the generate_text() function. It supports parameters like:
temperature: Controls randomness of responses.top_p: Nucleus sampling for response diversity.repetition_penalty: Prevents excessive repetition.The script includes an interactive mode where users can input queries:
python chatbot.py
To exit, type exit.
./saved_model../results and ./logs.facebook/bart-large-xsum.This project was created for research and development in chatbot training using transformer-based models.