GlobalBusinessAdvisors
commited on
Commit
•
0b62847
1
Parent(s):
f2dd871
Update app/main.py
Browse files- app/main.py +3 -15
app/main.py
CHANGED
@@ -1,24 +1,12 @@
|
|
1 |
from fastapi import FastAPI
|
2 |
-
import
|
3 |
-
from dotenv import load_dotenv
|
4 |
-
from ui.gradio_ui import create_ui
|
5 |
-
|
6 |
-
# Load environment variables from .env file
|
7 |
-
load_dotenv()
|
8 |
-
|
9 |
-
# Fetch the OpenAI API key from environment variables
|
10 |
-
openai_api_key = os.getenv('OPENAI_API_KEY')
|
11 |
|
12 |
app = FastAPI()
|
13 |
|
14 |
@app.on_event("startup")
|
15 |
-
def startup_event():
|
16 |
-
|
17 |
|
18 |
@app.get("/")
|
19 |
def read_root():
|
20 |
return {"message": "EcoPropertyRetrofitGPT API is running"}
|
21 |
-
|
22 |
-
if __name__ == "__main__":
|
23 |
-
import uvicorn
|
24 |
-
uvicorn.run(app, host="0.0.0.0", port=8000)
|
|
|
1 |
from fastapi import FastAPI
|
2 |
+
from app.gradio_ui import ui
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
|
4 |
app = FastAPI()
|
5 |
|
6 |
@app.on_event("startup")
|
7 |
+
async def startup_event():
|
8 |
+
ui.launch(server_name="0.0.0.0", server_port=7860, share=True)
|
9 |
|
10 |
@app.get("/")
|
11 |
def read_root():
|
12 |
return {"message": "EcoPropertyRetrofitGPT API is running"}
|
|
|
|
|
|
|
|