forked from VishwamAI/chat-agent
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathintegrate_text_to_text_features.sh
34 lines (24 loc) · 1.23 KB
/
integrate_text_to_text_features.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/bash
# Script to integrate text-to-text generation features from MTL-data-to-text model into Vishwamai model
# Ensure the script is executed from the root of the repository
cd "$(dirname "$0")"
# Activate the virtual environment
source venv/bin/activate
# Install the Transformers library if not already installed
pip install transformers
# Download the pre-trained MTL-data-to-text model and tokenizer
python - <<EOF
from transformers import MvpTokenizer, MvpForConditionalGeneration
tokenizer = MvpTokenizer.from_pretrained("RUCAIBox/mvp")
model = MvpForConditionalGeneration.from_pretrained("RUCAIBox/mtl-data-to-text")
# Save the tokenizer and model
tokenizer.save_pretrained("vishwamai/tokenizer")
model.save_pretrained("vishwamai/model")
EOF
# Adapt the Vishwamai model's code to incorporate the MTL-data-to-text model's tokenizer and generation methods
# This step may require manual intervention to modify the input and output processing to match the MTL-data-to-text model's expected formats
# Fine-tune the integrated model on the user's specific dataset
# Ensure the dataset is available in the `datasets` directory
python scripts/train_t5.py --config configs/config_for_9b.yaml
# Deactivate the virtual environment
deactivate