Spaces:
Sleeping
Sleeping
add root endpoint to provide welcome message for the Text Summarization API
Browse files
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))
|