Spaces:
Configuration error

chat / main.py
yonkasoft's picture
Update main.py
15f3506 verified
raw
history blame
510 Bytes
from fastapi import FastAPI
from pydantic import BaseModel
import os
app = FastAPI()
@app.get("/")
async def root():
return {"message": "Hello World"}
model = load_model()
client = MongoClient('mongodb://localhost:27017/')
db = client['']
collection = db['text']
class InputData(BaseModel):
title: str
keywords: str
subheadings: str
@app.post("/generate/")
async def generate(input_data: InputData):
result = model.predict(input_data)
return {"result": "generated_output"}