Spaces:
Runtime error
Runtime error
aus10powell
commited on
Commit
·
d4f732b
1
Parent(s):
1261d76
Update app.py
Browse files
app.py
CHANGED
@@ -210,6 +210,30 @@ async def generate_text(request: Request):
|
|
210 |
final_text= generated_text
|
211 |
return {"generated_text": final_text}
|
212 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
213 |
|
214 |
@app.get("/examples1")
|
215 |
async def read_examples():
|
|
|
210 |
final_text= generated_text
|
211 |
return {"generated_text": final_text}
|
212 |
|
213 |
+
@app.post("/api/generate_summary")
|
214 |
+
async def generate_summary(request: Request):
|
215 |
+
"""Generate summary from tweets
|
216 |
+
|
217 |
+
Args:
|
218 |
+
request: The HTTP request.
|
219 |
+
|
220 |
+
Returns:
|
221 |
+
The generated text.
|
222 |
+
"""
|
223 |
+
|
224 |
+
print("*" * 50)
|
225 |
+
data = await request.json()
|
226 |
+
|
227 |
+
# Get the list of text
|
228 |
+
texts = data["text"]
|
229 |
+
|
230 |
+
|
231 |
+
# Generate the summary
|
232 |
+
summary = "This is a placeholder for summary model being returned"
|
233 |
+
|
234 |
+
# Return the summary
|
235 |
+
return {"summary": summary}
|
236 |
+
|
237 |
|
238 |
@app.get("/examples1")
|
239 |
async def read_examples():
|