Can a race condition occur in asynchronous Python code?
Python
How many documents were retrieved during the search? Was there a reranking?
How did the semantic cache work in Redis?
How was the quality of the RAG system evaluated?
How did you monitor the service's operation? What did you look at in Grafana?
What else can be optimized in the predict method? (creating a DataFrame each time)
Why is it better to use POST instead of GET for this endpoint?
Write a web service in FastAPI that accepts a POST request with data (income, age, loan amount) and returns an ML model prediction (loan approval).
How to optimize a service so that a synchronous CPU task (model prediction) does not block the FastAPI event loop?
Tell about the entire pipeline of the RAG system: what documents were used, how they were loaded and processed?
What is Singleton and how to use it for model loading? What are the disadvantages of Singleton?
How long does the entire RAG pipeline from request to response usually take?
How were documents uploaded to the vector database? How was chunking performed?
If a local ML model (for example, a reranker) is used in an asynchronous service and is called synchronously, what problem arises and how can it be solved?
How were embeddings obtained? Through which model and how was it run?
How does multithreading work in Python considering GIL? What are the differences between threads and processes?