File size: 994 Bytes
1e31b65
 
 
b77eff1
95def1d
 
0ab693c
bb5e2fb
1e31b65
 
76e8dc6
 
 
 
 
 
 
1e31b65
 
 
c3b66d3
 
69b5a42
c3b66d3
b77eff1
1e31b65
afa5c15
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
from fastapi import FastAPI
from pydantic import BaseModel, validator
from utils import summary
import os
from huggingface_hub import login

os.environ['HF_HOME'] = '/hug/cache/'
os.environ['TRANSFORMERS_CACHE'] = '/blabla/cache/'

class Item(BaseModel):
    FileURL: str = "https://www.bseindia.com/stockinfo/AnnPdfOpen.aspx?Pname=d141ef4f-7856-4236-8f6f-efe09592df40.pdf"
    memo: str  = "Please find attached RTA Certificate u/r 74(5) of SEBI (DP) Regulations 2018 for QE March 2024"
    TypeofAnnouncement: str   = "General_Announcements"
    Descriptor: str   = "Certificate under Reg. 74 (5) of SEBI (DP) Regulations 2018"
    caption: str  = "Compliances-Certificate under Reg. 74 (5) of SEBI (DP) Regulations 2018"
    newsdate: str  = "2024-04-08T13:05:27"
    symbol: str = "EDELWEISS"

app = FastAPI()

@app.get("/")
async def root():
 return {"Summarize":"Version 1.5 'Images Added'"}

@app.post("/Summarize/")
def read_user(input_json: Item):
    return summary(input_json.dict())