forked from emmethalm/tuneAI
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_pipeline.sh
36 lines (28 loc) · 1021 Bytes
/
run_pipeline.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
35
36
#!/bin/bash
# Replace the paths below with the actual paths of the respective files
YOUTUBE_SCRAPER="scripts/youtube_scraper.ts"
CLEANER="scripts/cleaner.py"
PROMPT_COMPLETION_GEN="scripts/prompt_completion_gen.py"
OPENAI_API_KEY="your_openai_api_key_here" # Paste in your own API key here
# Check if a YouTube URL is provided as an argument
if [ -z "$1" ]; then
echo "Usage: ./run_pipeline.sh <YouTube_URL>"
exit 1
fi
# Run the YouTube scraper
echo "Running YouTube scraper..."
tsc $YOUTUBE_SCRAPER
node "${YOUTUBE_SCRAPER%.*}.js" "$1"
# Run the cleaner script
echo "Running cleaner.py..."
python $CLEANER
# Run the prompt-completion generator script
echo "Running prompt_completion_gen.py..."
python $PROMPT_COMPLETION_GEN
# Set the OpenAI API key
echo "Setting OpenAI API key..."
export OPENAI_API_KEY=$OPENAI_API_KEY
# Run the fine-tuning command
echo "Running OpenAI fine-tuning..."
openai api fine_tunes.create -t prompt_completion_pairs.jsonl -m davinci
echo "Pipeline complete. You did it, king."