Spaces:
Sleeping
Sleeping
Ajaykanth Maddi commited on
Commit Β·
c9b1554
1
Parent(s): af1da78
Code Changes - Updated the embedding models
Browse files- app.py +2 -3
- constants.py +7 -0
app.py
CHANGED
|
@@ -29,6 +29,7 @@ from utils import (
|
|
| 29 |
|
| 30 |
from constants import (
|
| 31 |
CHUNKING_STRATEGIES,
|
|
|
|
| 32 |
)
|
| 33 |
|
| 34 |
from ragbench import RAGSystem, RAGEvaluator
|
|
@@ -79,8 +80,6 @@ for item in ragbench_details.keys():
|
|
| 79 |
|
| 80 |
available_subsets = list(ragbench_details.keys())
|
| 81 |
|
| 82 |
-
# chunking_strategies = ["SentenceBasedLangchain", "Hybrid"]
|
| 83 |
-
embedding_models = ["BAAI/bge-large-en-v1.5", "intfloat/e5-large-v2"]
|
| 84 |
generator_models = ["mistralai/Mistral-7B-Instruct-v0.2"]
|
| 85 |
evaluators = ["llama"]
|
| 86 |
|
|
@@ -314,7 +313,7 @@ with gr.Blocks(
|
|
| 314 |
with gr.Column(scale=3):
|
| 315 |
gr.Markdown("### βοΈ Chunking and Model Selection")
|
| 316 |
chunking_dropdown = gr.Dropdown(choices=CHUNKING_STRATEGIES, label="π¦ Chunking Strategy", value="SentenceBasedLangchain")
|
| 317 |
-
embed_dropdown = gr.Dropdown(choices=
|
| 318 |
retriever_dropdown = gr.Dropdown(choices=generator_models, label="π§ Generator Model", value="mistralai/Mistral-7B-Instruct-v0.2")
|
| 319 |
|
| 320 |
with gr.Column(scale=4):
|
|
|
|
| 29 |
|
| 30 |
from constants import (
|
| 31 |
CHUNKING_STRATEGIES,
|
| 32 |
+
EMBEDDING_MODELS,
|
| 33 |
)
|
| 34 |
|
| 35 |
from ragbench import RAGSystem, RAGEvaluator
|
|
|
|
| 80 |
|
| 81 |
available_subsets = list(ragbench_details.keys())
|
| 82 |
|
|
|
|
|
|
|
| 83 |
generator_models = ["mistralai/Mistral-7B-Instruct-v0.2"]
|
| 84 |
evaluators = ["llama"]
|
| 85 |
|
|
|
|
| 313 |
with gr.Column(scale=3):
|
| 314 |
gr.Markdown("### βοΈ Chunking and Model Selection")
|
| 315 |
chunking_dropdown = gr.Dropdown(choices=CHUNKING_STRATEGIES, label="π¦ Chunking Strategy", value="SentenceBasedLangchain")
|
| 316 |
+
embed_dropdown = gr.Dropdown(choices=EMBEDDING_MODELS, label="π Embedding Model", value="BAAI/bge-large-en-v1.5")
|
| 317 |
retriever_dropdown = gr.Dropdown(choices=generator_models, label="π§ Generator Model", value="mistralai/Mistral-7B-Instruct-v0.2")
|
| 318 |
|
| 319 |
with gr.Column(scale=4):
|
constants.py
CHANGED
|
@@ -25,6 +25,13 @@ CHUNKING_STRATEGIES = [
|
|
| 25 |
# HYBRID
|
| 26 |
]
|
| 27 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
default_json = {
|
| 29 |
"relevance_explanation": "Documents 1 and 4 contain useful information for answering the question. Document 1 mentions 'Signal Information' and 'Self Diagnosis', which are relevant to finding signal information. Document 4 provides additional context about signal information, such as it being only available for digital channels.",
|
| 30 |
"all_relevant_sentence_keys": [
|
|
|
|
| 25 |
# HYBRID
|
| 26 |
]
|
| 27 |
|
| 28 |
+
|
| 29 |
+
EMBEDDING_MODELS = [
|
| 30 |
+
"BAAI/bge-large-en-v1.5",
|
| 31 |
+
"intfloat/e5-large-v2",
|
| 32 |
+
"all-MiniLM-L6-v2"
|
| 33 |
+
]
|
| 34 |
+
|
| 35 |
default_json = {
|
| 36 |
"relevance_explanation": "Documents 1 and 4 contain useful information for answering the question. Document 1 mentions 'Signal Information' and 'Self Diagnosis', which are relevant to finding signal information. Document 4 provides additional context about signal information, such as it being only available for digital channels.",
|
| 37 |
"all_relevant_sentence_keys": [
|