Spaces:
Configuration error

chat / main.py
yonkasoft's picture
Update main.py
1373351 verified
raw
history blame
439 Bytes
from fastapi import FastAPI
from pydantic import BaseModel
import os
app = FastAPI()
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"}