Spaces:
Configuration error
Configuration error
Update main.py
Browse files
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 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
db = client['']
|
14 |
-
collection = db['text']
|
15 |
-
|
16 |
|
|
|
|
|
17 |
|
18 |
-
|
19 |
-
|
20 |
-
keywords: str
|
21 |
-
subheadings: str
|
22 |
|
23 |
-
|
24 |
-
|
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()
|
|
|
|
|
|