Spaces:
Running
Running
swaroop-uddandarao
commited on
Commit
·
1ad280e
1
Parent(s):
bea31e7
added rerank model options
Browse files
app.py
CHANGED
@@ -40,7 +40,7 @@ print(rag_extracted_data.head(5))
|
|
40 |
EmbedAllDocumentsAndInsert(QUERY_EMBEDDING_MODEL, rag_extracted_data, db_collection, window_size=WINDOW_SIZE, overlap=OVERLAP)
|
41 |
"""
|
42 |
|
43 |
-
def EvaluateRAGModel(question, evaluation_model):
|
44 |
try:
|
45 |
start_time = time.time()
|
46 |
|
@@ -55,7 +55,10 @@ def EvaluateRAGModel(question, evaluation_model):
|
|
55 |
elif evaluation_model == "Deepseek 70b":
|
56 |
EVAL_MODEL = "deepseek-r1-distill-llama-70b"
|
57 |
PROMPT_MODEL = "deepseek-r1-distill-llama-70b"
|
58 |
-
|
|
|
|
|
|
|
59 |
#invoke create milvus db function
|
60 |
try:
|
61 |
db_collection = CreateMilvusDbSchema()
|
@@ -142,7 +145,7 @@ with gr.Blocks() as iface:
|
|
142 |
|
143 |
|
144 |
# Connect submit button to evaluation function
|
145 |
-
submit_button.click(EvaluateRAGModel, inputs=[question_input, dropdown_input], outputs=[response, rmsecontextrel, rmsecontextutil, aucscore, processingTime])
|
146 |
|
147 |
# Run the Gradio app
|
148 |
iface.launch()
|
|
|
40 |
EmbedAllDocumentsAndInsert(QUERY_EMBEDDING_MODEL, rag_extracted_data, db_collection, window_size=WINDOW_SIZE, overlap=OVERLAP)
|
41 |
"""
|
42 |
|
43 |
+
def EvaluateRAGModel(question, evaluation_model, reranking_model):
|
44 |
try:
|
45 |
start_time = time.time()
|
46 |
|
|
|
55 |
elif evaluation_model == "Deepseek 70b":
|
56 |
EVAL_MODEL = "deepseek-r1-distill-llama-70b"
|
57 |
PROMPT_MODEL = "deepseek-r1-distill-llama-70b"
|
58 |
+
|
59 |
+
# Get selected reranking model
|
60 |
+
RERANKING_MODEL = RERANKING_MODELS[reranking_model]
|
61 |
+
|
62 |
#invoke create milvus db function
|
63 |
try:
|
64 |
db_collection = CreateMilvusDbSchema()
|
|
|
145 |
|
146 |
|
147 |
# Connect submit button to evaluation function
|
148 |
+
submit_button.click(EvaluateRAGModel, inputs=[question_input, dropdown_input,reranker_dropdown], outputs=[response, rmsecontextrel, rmsecontextutil, aucscore, processingTime])
|
149 |
|
150 |
# Run the Gradio app
|
151 |
iface.launch()
|