alx-d commited on
Commit
24ac295
·
verified ·
1 Parent(s): 9236d0a

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. advanced_rag.py +6 -4
advanced_rag.py CHANGED
@@ -174,7 +174,7 @@ class ElevatedRagChain:
174
  time.sleep(backoff)
175
  backoff *= 2 # exponential backoff
176
  return response
177
- from langchain.llms.base import LLM
178
  class RemoteLLM(LLM):
179
  @property
180
  def _llm_type(self) -> str:
@@ -241,7 +241,7 @@ class ElevatedRagChain:
241
  device=-1,
242
  **extra_kwargs
243
  )
244
- from langchain.llms.base import LLM
245
  class LocalLLM(LLM):
246
  @property
247
  def _llm_type(self) -> str:
@@ -571,13 +571,15 @@ The response displays the model used, word count, and current context (with conv
571
  load_button.click(
572
  load_pdfs_updated,
573
  inputs=[pdf_input, model_dropdown, prompt_input, bm25_weight_slider, temperature_slider, top_p_slider],
574
- outputs=[response_output, context_output, model_output]
 
575
  )
576
 
577
  submit_button.click(
578
  submit_query_updated,
579
  inputs=[query_input],
580
- outputs=[response_output, context_output, input_tokens, output_tokens]
 
581
  )
582
 
583
  reset_button.click(
 
174
  time.sleep(backoff)
175
  backoff *= 2 # exponential backoff
176
  return response
177
+
178
  class RemoteLLM(LLM):
179
  @property
180
  def _llm_type(self) -> str:
 
241
  device=-1,
242
  **extra_kwargs
243
  )
244
+
245
  class LocalLLM(LLM):
246
  @property
247
  def _llm_type(self) -> str:
 
571
  load_button.click(
572
  load_pdfs_updated,
573
  inputs=[pdf_input, model_dropdown, prompt_input, bm25_weight_slider, temperature_slider, top_p_slider],
574
+ outputs=[response_output, context_output, model_output],
575
+ long_running=True # Added long_running flag
576
  )
577
 
578
  submit_button.click(
579
  submit_query_updated,
580
  inputs=[query_input],
581
+ outputs=[response_output, context_output, input_tokens, output_tokens],
582
+ long_running=True # Added long_running flag
583
  )
584
 
585
  reset_button.click(