79104078

Date: 2024-10-19 02:04:34
Score: 0.5
Natty:
Report link

When you run FastAPI app with uvicorn, it starts the app from main.py rather than directly executing your script. The working directory is likely set to the project root (project-astra), so python tries to find the prompts module from this folder. If it can't find it, you get the ModuleNotFoundError.

Try to add a . before prompts in classification_pipeline:

from .prompts import (
    json_example, json_extractor_prompt, 
    definitions
)

This will make python look for prompts inside the current pack where is classification_pipeline.py

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Starts with a question (0.5): When you
  • Low reputation (1):
Posted by: Michael SH