Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -162,5 +162,21 @@ def create_interface():
|
|
| 162 |
|
| 163 |
return interface
|
| 164 |
|
| 165 |
-
|
| 166 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 162 |
|
| 163 |
return interface
|
| 164 |
|
| 165 |
+
def main():
|
| 166 |
+
"""Main function to launch the application"""
|
| 167 |
+
|
| 168 |
+
# Check if API key is set
|
| 169 |
+
if not os.getenv('OPENAI_API_KEY'):
|
| 170 |
+
print("⚠️ Warning: OPENAI_API_KEY environment variable not found!")
|
| 171 |
+
print("Please set it using: export OPENAI_API_KEY='your-api-key-here'")
|
| 172 |
+
print("You can get your API key from: https://platform.openai.com/api-keys")
|
| 173 |
+
|
| 174 |
+
# Create and launch interface
|
| 175 |
+
interface = create_interface()
|
| 176 |
+
interface.launch(
|
| 177 |
+
share=False,
|
| 178 |
+
show_error=True
|
| 179 |
+
)
|
| 180 |
+
|
| 181 |
+
if __name__ == "__main__":
|
| 182 |
+
main()
|