Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -7,7 +7,9 @@ import toml # Import the toml library
|
|
| 7 |
|
| 8 |
# Load secrets from secrets.toml
|
| 9 |
try:
|
| 10 |
-
|
|
|
|
|
|
|
| 11 |
GEMINI_API_KEY = secrets["AIzaSyC_MFgpk5t3woYooMIPkIA5-Kzaon13-m0"]
|
| 12 |
except FileNotFoundError:
|
| 13 |
print("Error: secrets.toml not found. Make sure it exists in the same directory.")
|
|
|
|
| 7 |
|
| 8 |
# Load secrets from secrets.toml
|
| 9 |
try:
|
| 10 |
+
# Use os.path.join to ensure correct path
|
| 11 |
+
secrets_path = os.path.join(os.path.dirname(__file__), "secrets.toml")
|
| 12 |
+
secrets = toml.load(secrets_path)
|
| 13 |
GEMINI_API_KEY = secrets["AIzaSyC_MFgpk5t3woYooMIPkIA5-Kzaon13-m0"]
|
| 14 |
except FileNotFoundError:
|
| 15 |
print("Error: secrets.toml not found. Make sure it exists in the same directory.")
|