Commit
·
2539ad3
1
Parent(s):
5e71873
fix date format
Browse files
app.py
CHANGED
|
@@ -2,7 +2,6 @@ import os
|
|
| 2 |
import requests
|
| 3 |
from datetime import datetime
|
| 4 |
|
| 5 |
-
from bs4 import BeautifulSoup
|
| 6 |
|
| 7 |
import gradio as gr
|
| 8 |
from gradio import components
|
|
@@ -14,7 +13,7 @@ from langchain.docstore.document import Document
|
|
| 14 |
from openai.error import AuthenticationError
|
| 15 |
|
| 16 |
def comment_datetime(comment_json):
|
| 17 |
-
dt = datetime.fromisoformat(comment_json["created_at"])
|
| 18 |
return comment_json["user"]["login"] + " commented on " + dt.strftime("%b %d, %Y") + ":"
|
| 19 |
|
| 20 |
str_format = """
|
|
|
|
| 2 |
import requests
|
| 3 |
from datetime import datetime
|
| 4 |
|
|
|
|
| 5 |
|
| 6 |
import gradio as gr
|
| 7 |
from gradio import components
|
|
|
|
| 13 |
from openai.error import AuthenticationError
|
| 14 |
|
| 15 |
def comment_datetime(comment_json):
|
| 16 |
+
dt = datetime.fromisoformat(comment_json["created_at"][:-1])
|
| 17 |
return comment_json["user"]["login"] + " commented on " + dt.strftime("%b %d, %Y") + ":"
|
| 18 |
|
| 19 |
str_format = """
|