| | #!/bin/bash |
| |
|
| | |
| | set -e |
| |
|
| | |
| | if [ ! -d ".dvc" ]; then |
| | echo "Initializing DVC..." |
| | dvc init --no-scm |
| | dvc remote add -d origin https://dagshub.com/se4ai2526-uniba/Hopcroft.dvc |
| | fi |
| |
|
| | |
| | |
| | USER=${DAGSHUB_USERNAME:-$MLFLOW_TRACKING_USERNAME} |
| | PASS=${DAGSHUB_TOKEN:-$MLFLOW_TRACKING_PASSWORD} |
| |
|
| | if [ -n "$USER" ] && [ -n "$PASS" ]; then |
| | echo "Configuring DVC authentication for DagsHub..." |
| | |
| | dvc remote modify origin --local auth basic |
| | dvc remote modify origin --local user "$USER" |
| | dvc remote modify origin --local password "$PASS" |
| | else |
| | echo "WARNING: No DagsHub credentials found. DVC pull might fail if the remote is private." |
| | fi |
| |
|
| | echo "Pulling models from DVC..." |
| | |
| | dvc pull models/random_forest_tfidf_gridsearch.pkl.dvc \ |
| | models/tfidf_vectorizer.pkl.dvc \ |
| | models/label_names.pkl.dvc |
| |
|
| | echo "Starting FastAPI application in background..." |
| | uvicorn hopcroft_skill_classification_tool_competition.main:app --host 0.0.0.0 --port 8000 & |
| |
|
| | |
| | echo "Waiting for API to start..." |
| | sleep 10 |
| |
|
| | echo "Starting Streamlit application..." |
| | export API_BASE_URL="http://localhost:8000" |
| | streamlit run hopcroft_skill_classification_tool_competition/streamlit_app.py --server.port 7860 --server.address 0.0.0.0 |
| |
|