https-deeplearning-ai / machine-learning-engineering-for-production-public

Public repo for DeepLearning.AI MLEP Specialization
Apache License 2.0
1.85k stars 2.36k forks source link

C4 W3 Ungraded Lab 4 - scikit-learn backward incompatable version #107

Closed arvyzukai closed 11 months ago

arvyzukai commented 11 months ago

item

This issue was already raised but the Course content was not changed so I raised the issue in order to pull all the aspects of the problem to one place.

The main problem is that the pickled model version is backward incompatible. To remedy that the requirements.txt need to be modified to include the old scikit-learn version:

fastapi uvicorn scikit-learn==0.24.2 pytest

That also requires older Cython version, so the .github/workflows/course4-week3-lab.yml should be modified with older Python version:

  - 
    name: Set up Python
    uses: actions/setup-python@v4
    with:
      python-version: '3.8'

And for cleanness the workflow versions should be updated to v4 (as above) and in:

  - 
    name: Checkout
    uses: actions/checkout@v4

Also, the main.py should be modified with correct parameters (min_items -> min_length, max_items -> max_length) for the classifier:

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

After implementing these steps the future learners should not have distractions with compatibility issues and could focus on Course material.

justrp commented 11 months ago

I don't really care about worklow versions while they work :) Also - instead of pydantic parameters update I've specified pydantic version that was (probably) used when the course was created.

108

arvyzukai commented 11 months ago

Fair enough :)

cfav-dev commented 11 months ago

Hi Arvydas! Thank you for reporting, and sorry for the delay! The problematic files are now updated, so the learners shouldn't run into the issues anymore.