I’m working on C1M2 - Implementing Retriever Functions in a RAG System. All three graded functions (bm25_retrieve, semantic_search_retrieve, reciprocal_rank_fusion) produce correct expected outputs when run interactively, and all unit tests pass with “All tests passed!”
However, when I submit for grading, I get this for all three parts:
“There was a problem compiling the code from your notebook, please check that you saved before submitting. Details: name ‘model’ is not defined”
What I’ve already tried, multiple times:
Kernel → Restart Kernel and Clear All Outputs, then Run → Run All Cells from the very top. This completes with no errors anywhere in the notebook. The cell defining model = SentenceTransformer("BAAI/bge-base-en-v1.5", cache_folder=os.environ['MODEL_PATH']) runs successfully (it shows a harmless warning about HF Hub rate limits and a read-only filesystem cache path, but the model loads and model.encode(...) works correctly afterward).
Explicitly saving the notebook (File → Save Notebook, confirmed “Saving completed”) before every resubmission.
Checked my semantic_search_retrieve function for stray debug statements or code outside the START/END CODE HERE markers, in case the grader compiles function bodies in isolation — I don’t see anything obviously extra, but I may be missing something.
Given the model loads fine in my interactive session, I suspect this might be related to how the grading sandbox handles the HuggingFace Hub download/cache for BAAI/bge-base-en-v1.5, possibly a rate limit or read-only filesystem issue that’s fatal in the grading environment even though it’s just a warning interactively. I found a similar closed thread (Problem compiling the code - Implementing Retriever Functions in a RAG System - C1M2) where the root cause turned out to be leftover debug code, so I want to rule that out too, but wanted to ask in case this is a known/separate issue specific to the embedding model loading step.