scholarly360 commited on
Commit
7e2a0c4
·
verified ·
1 Parent(s): 9eca3cd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -2
app.py CHANGED
@@ -162,5 +162,21 @@ def create_interface():
162
 
163
  return interface
164
 
165
- demo = gr.Interface(fn=create_interface, inputs="text", outputs="text")
166
- demo.launch()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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()