Skip to content

Commit

Permalink
chore: update
Browse files Browse the repository at this point in the history
  • Loading branch information
jfrery committed Apr 15, 2024
1 parent d217ffb commit 3fbef88
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 16 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/run_use_cases_examples.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ jobs:
- name: Set up Environment
run: |
# Setup commands if any, for example, installing dependencies, etc.
apt-get update && apt-get install -y python3-venv make && apt install git git-lfs -y
apt-get update && apt-get install -y python3-venv make git git-lfs
# Initialize Git LFS and pull the files
git lfs install
git lfs pull
- name: Run Use Case Examples Script
run: |
Expand Down
24 changes: 10 additions & 14 deletions script/make_utils/run_use_case_examples.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,24 +31,19 @@ setup_virtualenv() {
echo "Virtual environment activated."
}

install_concrete_ml() {
pip install -U pip setuptools wheel
if pip install -e .; then
echo "Concrete ML installation successful."
else
echo "Failed to install Concrete ML."
return 1
fi
}

install_requirements() {
if [ -f "requirements.txt" ]; then
pip install -U pip setuptools wheel
local example_dir=$1
if [ -f "${example_dir}/requirements.txt" ]; then
pushd "$example_dir"
if pip install -r requirements.txt; then
echo "Requirements installed successfully."
else
echo "Failed to install requirements."
popd
return 1
fi
popd
fi
}

Expand All @@ -63,13 +58,14 @@ run_example() {

echo "*** Running example: $example_name ***"
setup_virtualenv "$example_name"
install_concrete_ml || return
install_requirements || return
install_requirements "$example_dir" || return

set +e
echo "Running use case example using Makefile..."
make -C "$example_dir" run_example
set -e

local result="${PIPESTATUS[0]}"
local result=$?

if [ "$result" -ne 0 ]; then
echo "Failure in example $example_name."
Expand Down
4 changes: 3 additions & 1 deletion use_case_examples/federated_learning/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ PYTHON_RUN=python
run_example: run_sh load_to_cml

run_sh:
@echo "Running federated learning training script..."
@./run.sh

load_to_cml:
@$(PYTHON_RUN) load_to_cml.py
@echo "Loading and compiling the model with Concrete ML..."
@$(PYTHON_RUN) load_to_cml.py
13 changes: 13 additions & 0 deletions use_case_examples/hybrid_model/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Useful for jupyter notebooks
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8

EXAMPLE_NAME=hybrid_model

run_example: compile_model serve_model

compile_model:
@python compile_hybrid_llm.py

serve_model:
@./serve.sh
1 change: 1 addition & 0 deletions use_case_examples/hybrid_model/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
concrete-ml
datasets==2.14.4
apache_beam==2.49.0
mwparserfromhell==0.6.4
Expand Down

0 comments on commit 3fbef88

Please sign in to comment.