From d4f258c6ae4184e7a6e1f93f87e16e9ddd09f353 Mon Sep 17 00:00:00 2001 From: Shantanu Oak Date: Fri, 3 Feb 2023 04:57:41 +0000 Subject: [PATCH 1/3] Update utils.py --- promptify/models/nlp/utils/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/promptify/models/nlp/utils/utils.py b/promptify/models/nlp/utils/utils.py index e2f46a5..7d56842 100644 --- a/promptify/models/nlp/utils/utils.py +++ b/promptify/models/nlp/utils/utils.py @@ -31,7 +31,7 @@ def download(url, destination_file): for chunk in response.iter_content(chunk_size=1048576): f.write(chunk) - if last_modified := response.headers.get("last-modified"): + if last_modified == response.headers.get("last-modified"): new_mtime = parsedate_to_datetime(last_modified).timestamp() os.utime(destination_file, times=(datetime.now().timestamp(), new_mtime)) return destination_file From 9152939e1387bada6d764dcb8128879a5c3bf2b7 Mon Sep 17 00:00:00 2001 From: Shantanu Oak Date: Fri, 3 Feb 2023 05:27:28 +0000 Subject: [PATCH 2/3] syntax compatible with version 3.7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit No need of “walrus operator” --- promptify/models/nlp/utils/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/promptify/models/nlp/utils/utils.py b/promptify/models/nlp/utils/utils.py index 7d56842..224ff7f 100644 --- a/promptify/models/nlp/utils/utils.py +++ b/promptify/models/nlp/utils/utils.py @@ -31,7 +31,8 @@ def download(url, destination_file): for chunk in response.iter_content(chunk_size=1048576): f.write(chunk) - if last_modified == response.headers.get("last-modified"): + last_modified = response.headers.get("last-modified") + if last_modified: new_mtime = parsedate_to_datetime(last_modified).timestamp() os.utime(destination_file, times=(datetime.now().timestamp(), new_mtime)) return destination_file From 0e75ed6cfd66fc01cffda8dbc7a9fb72361400da Mon Sep 17 00:00:00 2001 From: Shantanu Oak Date: Fri, 3 Feb 2023 06:39:13 +0000 Subject: [PATCH 3/3] added closing bracket --- promptify/prompts/nlp/templates/summary.jinja | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/promptify/prompts/nlp/templates/summary.jinja b/promptify/prompts/nlp/templates/summary.jinja index ab481a1..de63d60 100644 --- a/promptify/prompts/nlp/templates/summary.jinja +++ b/promptify/prompts/nlp/templates/summary.jinja @@ -11,7 +11,7 @@ You are a highly intelligent {{ domain }} domain expert Summarization system. Yo {% else %} You are a highly intelligent Summarization system. You take Passage as input and summarize the passage as an expert. {% endif -%} -Your output format is only {{ output_format|default("[{'S': Summarization paragraph}},]") } form, no other form. +Your output format is only {{ output_format|default("[{'S': Summarization paragraph}},]") }} form, no other form. Passage: {{ text_input }} Output: