Spaces:
Configuration error

yonkasoft commited on
Commit
607e45b
1 Parent(s): e74137c

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +13 -16
main.py CHANGED
@@ -1,27 +1,24 @@
1
  from fastapi import FastAPI
2
  from pydantic import BaseModel
 
 
 
3
 
4
  import os
5
  app = FastAPI()
6
 
7
  @app.get("/")
8
  async def root():
9
- return {"message": "Hello World"}
10
- model = load_model()
11
-
12
- client = MongoClient('mongodb://localhost:27017/')
13
- db = client['']
14
- collection = db['text']
15
-
16
 
 
 
17
 
18
- class InputData(BaseModel):
19
- title: str
20
- keywords: str
21
- subheadings: str
22
 
23
- @app.post("/generate/")
24
- async def generate(input_data: InputData):
25
-
26
- result = model.predict(input_data)
27
- return {"result": "generated_output"}
 
1
  from fastapi import FastAPI
2
  from pydantic import BaseModel
3
+ from app.model import create_model
4
+ from app.database import connect_to_database
5
+ from app.integration import integrate_data
6
 
7
  import os
8
  app = FastAPI()
9
 
10
  @app.get("/")
11
  async def root():
12
+
13
+ def main():
14
+ # Veritabanına bağlan
15
+ db_connection = connect_to_database()
 
 
 
16
 
17
+ # Modeli oluştur
18
+ model = create_model()
19
 
20
+ # Veriyi entegre et
21
+ integrate_data(db_connection, model)
 
 
22
 
23
+ if __name__ == "__main__":
24
+ main()