fix
Browse files
app.py
CHANGED
|
@@ -2,6 +2,11 @@ import os
|
|
| 2 |
import gradio as gr
|
| 3 |
import requests
|
| 4 |
import openai
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
|
| 6 |
# Set your OpenAI API key
|
| 7 |
openai.api_key = os.getenv("OPENAI_API_KEY", "your_openai_api_key")
|
|
@@ -55,6 +60,7 @@ def process_location(coords):
|
|
| 55 |
address = get_address(lat, lon)
|
| 56 |
if address.startswith("Error"):
|
| 57 |
return address, "Street information unavailable due to address retrieval error."
|
|
|
|
| 58 |
street_name = address.split(",")[0]
|
| 59 |
street_info = get_street_info(street_name)
|
| 60 |
return address, street_info
|
|
|
|
| 2 |
import gradio as gr
|
| 3 |
import requests
|
| 4 |
import openai
|
| 5 |
+
import logging
|
| 6 |
+
|
| 7 |
+
# Set up logging
|
| 8 |
+
logging.basicConfig(level=logging.INFO)
|
| 9 |
+
logger = logging.getLogger(__name__)
|
| 10 |
|
| 11 |
# Set your OpenAI API key
|
| 12 |
openai.api_key = os.getenv("OPENAI_API_KEY", "your_openai_api_key")
|
|
|
|
| 60 |
address = get_address(lat, lon)
|
| 61 |
if address.startswith("Error"):
|
| 62 |
return address, "Street information unavailable due to address retrieval error."
|
| 63 |
+
logging.info(f"Retrieved address: {address}")
|
| 64 |
street_name = address.split(",")[0]
|
| 65 |
street_info = get_street_info(street_name)
|
| 66 |
return address, street_info
|