From d48bb966d1a25dd2739295252dd0eed30a0ec061 Mon Sep 17 00:00:00 2001 From: Han Date: Mon, 5 Jun 2023 14:51:31 +0800 Subject: [PATCH 1/4] Adjust spelling --- app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.py b/app.py index 7827249..0dfb917 100644 --- a/app.py +++ b/app.py @@ -19,7 +19,7 @@ def ask_api( return '[ERROR]: Both URL and PDF is empty. Provide atleast one.' if url.strip() != '' and file != None: - return '[ERROR]: Both URL and PDF is provided. Please provide only one (eiter URL or PDF).' + return '[ERROR]: Both URL and PDF is provided. Please provide only one (either URL or PDF).' if question.strip() == '': return '[ERROR]: Question field is empty' From 258a61a8bf52cb76a5fdd137fe8e52371f4495ff Mon Sep 17 00:00:00 2001 From: Han Date: Mon, 5 Jun 2023 14:51:58 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=F0=9F=92=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.py b/app.py index 0dfb917..8ae1010 100644 --- a/app.py +++ b/app.py @@ -16,7 +16,7 @@ def ask_api( return '[ERROR]: Invalid API Host' if url.strip() == '' and file == None: - return '[ERROR]: Both URL and PDF is empty. Provide atleast one.' + return '[ERROR]: Both URL and PDF is empty. Provide at least one.' if url.strip() != '' and file != None: return '[ERROR]: Both URL and PDF is provided. Please provide only one (either URL or PDF).' From 46a6bd872220fd1bfec0f99e61db120d54970ab6 Mon Sep 17 00:00:00 2001 From: Han Date: Mon, 5 Jun 2023 14:52:38 +0800 Subject: [PATCH 3/4] remove the unused variables --- api.py | 1 - 1 file changed, 1 deletion(-) diff --git a/api.py b/api.py index 3e09e01..bd13f58 100644 --- a/api.py +++ b/api.py @@ -47,7 +47,6 @@ def pdf_to_text(path, start_page=1, end_page=None): def text_to_chunks(texts, word_length=150, start_page=1): text_toks = [t.split(' ') for t in texts] - page_nums = [] chunks = [] for idx, words in enumerate(text_toks): From ce8f9f42abcc27d03142174cf4a5c51f1a68c1b9 Mon Sep 17 00:00:00 2001 From: Han Date: Mon, 5 Jun 2023 15:18:28 +0800 Subject: [PATCH 4/4] replace f-string to string --- app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.py b/app.py index 8ae1010..04a3a6a 100644 --- a/app.py +++ b/app.py @@ -66,7 +66,7 @@ with gr.Blocks() as demo: placeholder='http://localhost:8080', ) gr.Markdown( - f'

Get your Open AI API key here

' + '

Get your Open AI API key here

' ) openAI_key = gr.Textbox( label='Enter your OpenAI API key here', type='password'