Update app.py
Browse files
app.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
from flask import Flask, render_template, request
|
| 2 |
-
import config
|
| 3 |
import os
|
| 4 |
import openai
|
| 5 |
|
|
@@ -12,11 +12,11 @@ def page_not_found(e):
|
|
| 12 |
|
| 13 |
##Initialising FLAK
|
| 14 |
app = Flask(__name__)
|
| 15 |
-
app.config.from_object(config.config['development'])
|
| 16 |
app.register_error_handler(404, page_not_found)
|
| 17 |
|
| 18 |
### Initialise the OPENAI library with the key saved in the CONFIG file
|
| 19 |
-
openai.api_key = app.config['OPENAI_KEY']
|
| 20 |
|
| 21 |
|
| 22 |
|
|
@@ -50,4 +50,4 @@ def index():
|
|
| 50 |
|
| 51 |
#Run Flask
|
| 52 |
if __name__ == '__main__':
|
| 53 |
-
app.run(host='0.0.0.0', port='
|
|
|
|
| 1 |
from flask import Flask, render_template, request
|
| 2 |
+
#import config
|
| 3 |
import os
|
| 4 |
import openai
|
| 5 |
|
|
|
|
| 12 |
|
| 13 |
##Initialising FLAK
|
| 14 |
app = Flask(__name__)
|
| 15 |
+
#app.config.from_object(config.config['development'])
|
| 16 |
app.register_error_handler(404, page_not_found)
|
| 17 |
|
| 18 |
### Initialise the OPENAI library with the key saved in the CONFIG file
|
| 19 |
+
openai.api_key = os.environ["open_key"]#app.config['OPENAI_KEY']
|
| 20 |
|
| 21 |
|
| 22 |
|
|
|
|
| 50 |
|
| 51 |
#Run Flask
|
| 52 |
if __name__ == '__main__':
|
| 53 |
+
app.run(host='0.0.0.0', port='7860')
|