broadfield-dev commited on
Commit
833eb54
·
verified ·
1 Parent(s): c136c04

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -17,6 +17,7 @@ def index():
17
  "category": doc.metadata["category"],
18
  "sentiment": doc.metadata["sentiment"],
19
  "published": doc.metadata["published"],
 
20
  }
21
  for doc in stored_docs
22
  ]
@@ -33,6 +34,7 @@ def index():
33
  "category": doc.metadata["category"],
34
  "sentiment": doc.metadata["sentiment"],
35
  "published": doc.metadata["published"],
 
36
  }
37
  for doc in results
38
  ]
@@ -47,4 +49,4 @@ def index():
47
  return render_template("index.html", categorized_articles=categorized_articles)
48
 
49
  if __name__ == "__main__":
50
- app.run(host="0.0.0.0", port=7860)
 
17
  "category": doc.metadata["category"],
18
  "sentiment": doc.metadata["sentiment"],
19
  "published": doc.metadata["published"],
20
+ "image": doc.metadata.get("image", "https://via.placeholder.com/150"), # Default image if none
21
  }
22
  for doc in stored_docs
23
  ]
 
34
  "category": doc.metadata["category"],
35
  "sentiment": doc.metadata["sentiment"],
36
  "published": doc.metadata["published"],
37
+ "image": doc.metadata.get("image", "https://via.placeholder.com/150"),
38
  }
39
  for doc in results
40
  ]
 
49
  return render_template("index.html", categorized_articles=categorized_articles)
50
 
51
  if __name__ == "__main__":
52
+ app.run(debug=True, host="0.0.0.0", port=5000)