Spaces:
Sleeping
Sleeping
Update api.py
Browse files
api.py
CHANGED
@@ -6,7 +6,7 @@ import tensorflow as tf
|
|
6 |
from scraper import scrape_text
|
7 |
from fastapi import FastAPI, Response
|
8 |
from typing import List
|
9 |
-
from pydantic import BaseModel
|
10 |
import uvicorn
|
11 |
import json
|
12 |
import logging
|
@@ -117,11 +117,11 @@ summ_tokenizer, summ_model = load_summarizer_models()
|
|
117 |
|
118 |
|
119 |
class URLList(BaseModel):
|
120 |
-
urls: List[str] = Field(..., description="List of URLs of news articles")
|
121 |
key: str = Field(..., description="Authentication Key")
|
122 |
|
123 |
class Summary(BaseModel):
|
124 |
-
urls: List[str] = Field(..., description="List of URLs of news articles")
|
125 |
scraped_texts: List[str] = Field(..., description="List of scraped text from input URLs")
|
126 |
scrape_errors: List[str] = Field("", description="List of errors raised during scraping. One item for corresponding URL")
|
127 |
summaries: List[str] = Field(..., description="List of generated summaries of news articles")
|
|
|
6 |
from scraper import scrape_text
|
7 |
from fastapi import FastAPI, Response
|
8 |
from typing import List
|
9 |
+
from pydantic import BaseModel, Field
|
10 |
import uvicorn
|
11 |
import json
|
12 |
import logging
|
|
|
117 |
|
118 |
|
119 |
class URLList(BaseModel):
|
120 |
+
urls: List[str] = Field(..., description="List of URLs of news articles to generate summaries")
|
121 |
key: str = Field(..., description="Authentication Key")
|
122 |
|
123 |
class Summary(BaseModel):
|
124 |
+
urls: List[str] = Field(..., description="List of URLs of news articles inputted by the user")
|
125 |
scraped_texts: List[str] = Field(..., description="List of scraped text from input URLs")
|
126 |
scrape_errors: List[str] = Field("", description="List of errors raised during scraping. One item for corresponding URL")
|
127 |
summaries: List[str] = Field(..., description="List of generated summaries of news articles")
|