-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathannotate.sh
More file actions
executable file
·40 lines (29 loc) · 1.25 KB
/
annotate.sh
File metadata and controls
executable file
·40 lines (29 loc) · 1.25 KB
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
37
38
39
40
#!/bin/bash
if [[ -z "${OPEN_AI_API_KEY}" ]]; then
echo "The openai api key env var is not set, please set a value and reinvoke"
exit 1
fi
# do google authentication to go through the project setup for gemini
gcloud auth application-default login
# login in huggingface hub to get codebert and save token on machine
huggingface-cli login
echo "Enter your programming language, e.g. C, go, java, js, or python:"
read lang
echo "got: $lang"
echo "Enter your initials: "
read initials
echo "got: $initials"
# could give them as cmd line args
# openai key export and google auth login need to be performed before start
# modify `config.py` for lang first-before running this script
# follow terminal to interact with app
# initdb and for each lang and each user (every time we each run annotate.sh)
flask --app vec_search init-db
flask --app vec_search run --debug
flask --app vec_search export-rad-to-csv rad-$lang-lang-$initials.csv
for provider in aws openai gemini;
do
echo "Generating relevances for: $provider";
flask --app vec_search gen-llm-rels rad-$lang-lang-$initials.csv llm_gen_rel-$provider-$lang-$initials.csv $provider
flask --app vec_search gen-ir-metrics llm_gen_rel-$provider-$lang-$initials.csv > metrics-$provider-$lang-$initials.txt
done;