ai-benchmark/run.sh
second_constantine 8ef3a16e3a feat: add MongoDB test generation and update dependencies
- Added pymongo==3.13.0 to requirements.txt for MongoDB connectivity
- Implemented generate_summarization_from_mongo.py script to generate summarization tests from MongoDB
- Updated run.sh to support 'gen-mongo' command for MongoDB test generation
- Enhanced scripts/README.md with documentation for new MongoDB functionality
- Improved help text in run.sh to clarify available commands and usage examples
```

This commit adds MongoDB integration for test generation and updates the documentation and scripts accordingly.
2026-01-22 20:11:52 +03:00

68 lines
2.3 KiB
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
# Получаем имя ядра (Linux Linux, macOS Darwin, FreeBSD FreeBSD …)
OS_NAME=$(uname -s)
init() {
if [[ "$OS_NAME" == "Darwin" ]]; then
python3.13 -m venv z
else
python3 -m venv z
fi
upd
}
upd() {
activate
pip install -r requirements.txt --upgrade
git submodule update --remote --merge
}
clean() {
rm -rf results/*
echo "Отчеты успешно очищены"
}
activate() {
source z/bin/activate
}
echo "_= Project Scripts =_"
if [ -n "$1" ]; then
if [[ "$1" == "init" ]]; then
init
elif [[ "$1" == "upd" ]]; then
upd
elif [[ "$1" == "run" ]]; then
activate
shift
python src/main.py "$@"
elif [[ "$1" == "clean" ]]; then
clean
elif [[ "$1" == "gen" ]]; then
activate
echo "🤖 Генерирую тесты через Ollama..."
python scripts/generate_tests.py --count 1 --category all --model second_constantine/t-lite-it-1.0:7b --ollama-url http://10.0.0.4:11434
echo "✅ Тесты успешно сгенерированы"
elif [[ "$1" == "gen-mongo" ]]; then
activate
echo "🔍 Генерирую тесты пересказов из MongoDB... "
python scripts/generate_summarization_from_mongo.py --record-id "$2"
echo "✅ Тесты из MongoDB успешно сгенерированы"
fi
else
echo " Аргументом необходимо написать название скрипта (+опционально аргументы скрипта)"
echo "Скрипты:"
echo " * init - инициализация, устанавливает env"
echo " * upd - обновление зависимостей"
echo " * run - запуск бенчмарков (translation, summarization, codegen)"
echo " * clean - очистка отчетов"
echo " * gen - генерация тестов через Ollama (translation, summarization, codegen)"
echo " * gen-mongo - генерация тестов пересказов из MongoDB (использование: ./run.sh gen-mongo <record-id> [output-dir])"
echo ""
echo "Примеры использования:"
echo " * ./run.sh run -m second_constantine/t-lite-it-1.0:7b -b translation summarization"
echo " * ./run.sh gen"
echo " * ./run.sh gen-mongo 507f1f77bcf86cd799439011"
fi