Spaces:
Configuration error
Configuration error
File size: 439 Bytes
1373351 3fbfa5d 1373351 3fbfa5d 1373351 0977ffe 7232476 1373351 100bced 7232476 1373351 7232476 1373351 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
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"}
|