Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -23,9 +23,6 @@ import pillow_heif # --- ADDED TO SUPPORT HEIC/HEIF IMAGE FORMATS
|
|
| 23 |
# This line registers the HEIC/HEIF plugin with Pillow
|
| 24 |
pillow_heif.register_heif_opener()
|
| 25 |
|
| 26 |
-
# --- NEW: Define paths relative to the script's location for robustness ---
|
| 27 |
-
SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__))
|
| 28 |
-
|
| 29 |
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
|
| 30 |
logger = logging.getLogger(__name__)
|
| 31 |
|
|
@@ -38,9 +35,9 @@ if not client.api_key:
|
|
| 38 |
# In a live app, you might want a more visible error in the UI
|
| 39 |
# raise ValueError("Missing OPENAI_API_KEY")
|
| 40 |
|
| 41 |
-
PROMPT_FILE_RECIPE_CONVERTER =
|
| 42 |
-
PROMPT_FILE_WEB_SEARCH =
|
| 43 |
-
RECIPE_DIR =
|
| 44 |
GPT_MODEL = "gpt-3.5-turbo"
|
| 45 |
|
| 46 |
# --- Pydantic Models (Unchanged) ---
|
|
|
|
| 23 |
# This line registers the HEIC/HEIF plugin with Pillow
|
| 24 |
pillow_heif.register_heif_opener()
|
| 25 |
|
|
|
|
|
|
|
|
|
|
| 26 |
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
|
| 27 |
logger = logging.getLogger(__name__)
|
| 28 |
|
|
|
|
| 35 |
# In a live app, you might want a more visible error in the UI
|
| 36 |
# raise ValueError("Missing OPENAI_API_KEY")
|
| 37 |
|
| 38 |
+
PROMPT_FILE_RECIPE_CONVERTER = "prompts/recipe_converter.xml"
|
| 39 |
+
PROMPT_FILE_WEB_SEARCH = "prompts/web_search_query_generator.xml"
|
| 40 |
+
RECIPE_DIR = "recipes" # Directory for local PDF/text recipes
|
| 41 |
GPT_MODEL = "gpt-3.5-turbo"
|
| 42 |
|
| 43 |
# --- Pydantic Models (Unchanged) ---
|