Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -34,7 +34,7 @@ def rag_pipeline(query: str, k_retrieved: int = 10, k_reranked: int = 5):
|
|
34 |
query_with_context = (
|
35 |
f"Context: {documents['chunk'].to_list()[:k_reranked]}\n\nQuery: {query}"
|
36 |
)
|
37 |
-
return generate_response_api(query_with_context), documents
|
38 |
|
39 |
|
40 |
with gr.Blocks() as demo:
|
@@ -70,7 +70,7 @@ with gr.Blocks() as demo:
|
|
70 |
)
|
71 |
|
72 |
submit_btn.click(
|
73 |
-
fn=
|
74 |
inputs=[query_input, retrieve_slider, rerank_slider],
|
75 |
outputs=[response_output, documents_output],
|
76 |
)
|
|
|
34 |
query_with_context = (
|
35 |
f"Context: {documents['chunk'].to_list()[:k_reranked]}\n\nQuery: {query}"
|
36 |
)
|
37 |
+
return generate_response_api(query_with_context).content, documents
|
38 |
|
39 |
|
40 |
with gr.Blocks() as demo:
|
|
|
70 |
)
|
71 |
|
72 |
submit_btn.click(
|
73 |
+
fn=rag_pipeline,
|
74 |
inputs=[query_input, retrieve_slider, rerank_slider],
|
75 |
outputs=[response_output, documents_output],
|
76 |
)
|