pius-code commited on
Commit
8008531
·
1 Parent(s): 3cc7319

add root endpoint to provide welcome message for the Text Summarization API

Browse files
Files changed (1) hide show
  1. main.py +5 -0
main.py CHANGED
@@ -9,6 +9,11 @@ summarizer = pipeline("summarization", model="facebook/bart-large-cnn")
9
  class TextInput(BaseModel):
10
  text: str
11
 
 
 
 
 
 
12
  @app.post("/summarize")
13
  async def summarize_text(input: TextInput):
14
  summary = (summarizer(input.text, max_length=130, min_length=30, do_sample=False))
 
9
  class TextInput(BaseModel):
10
  text: str
11
 
12
+
13
+ @app.get("/")
14
+ async def root():
15
+ return {"message": "Welcome to the Text Summarization API!"}
16
+
17
  @app.post("/summarize")
18
  async def summarize_text(input: TextInput):
19
  summary = (summarizer(input.text, max_length=130, min_length=30, do_sample=False))