Skip to content

Commit

Permalink
fix(C4 W3 lab 4): fix compatibility issues with workflow and app depe…
Browse files Browse the repository at this point in the history
…ndencies
  • Loading branch information
cfav-dev committed Nov 7, 2023
1 parent 725929b commit da27027
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 15 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/course4-week3-lab.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,19 @@ jobs:
run:
# Use bash as the shell
shell: bash
# Specify the working directory for the worflow
# Specify the working directory for the workflow
working-directory: course4/week3-ungraded-labs/C4_W3_Lab_4_Github_Actions/

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
-
name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
-
name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: '3.11'
python-version: '3.8'
-
name: Install dependencies
run: |
Expand All @@ -41,4 +41,4 @@ jobs:
name: Test with pytest
run: |
cd app/
pytest
pytest
Original file line number Diff line number Diff line change
Expand Up @@ -88,20 +88,21 @@ jobs:
steps:
-
name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
-
name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: '3.7.7'
python-version: '3.8'
-
name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install numpy fastapi uvicorn scikit-learn pytest
pip install -r requirements.txt
-
name: Test with pytest
run: |
cd app/
pytest
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@


class Wine(BaseModel):
batches: List[conlist(item_type=float, min_items=13, max_items=13)]
batches: List[conlist(item_type=float, min_length=13, max_length=13)]


@app.post("/predict")
def predict(wine: Wine):
batches = wine.batches
np_batches = np.array(batches)
pred = clf.predict(np_batches).tolist()
return {"Prediction": pred}
return {"Prediction": pred}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
fastapi
uvicorn
scikit-learn
pytest
fastapi==0.104.1
uvicorn==0.24.0
scikit-learn==0.24.2
pytest==7.4.3

0 comments on commit da27027

Please sign in to comment.