|
|
|
@ -16,10 +16,10 @@ 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 (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'
|
|
|
|
@ -66,7 +66,7 @@ with gr.Blocks() as demo:
|
|
|
|
|
placeholder='http://localhost:8080',
|
|
|
|
|
)
|
|
|
|
|
gr.Markdown(
|
|
|
|
|
f'<p style="text-align:center">Get your Open AI API key <a href="https://platform.openai.com/account/api-keys">here</a></p>'
|
|
|
|
|
'<p style="text-align:center">Get your Open AI API key <a href="https://platform.openai.com/account/api-keys">here</a></p>'
|
|
|
|
|
)
|
|
|
|
|
openAI_key = gr.Textbox(
|
|
|
|
|
label='Enter your OpenAI API key here', type='password'
|
|
|
|
|