Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -109,7 +109,7 @@ with gr.Blocks(title="Quiz Maker", theme=colorful_theme) as QUIZBOT:
|
|
109 |
|
110 |
with gr.Row():
|
111 |
difficulty_radio = gr.Radio(["easy", "average", "hard"], label="How difficult should the quiz be?")
|
112 |
-
model_radio = gr.Radio(choices=[
|
113 |
value='(ACCURATE) BGE reranker', label="Embeddings",
|
114 |
info="First query to ColBERT may take a little time")
|
115 |
|
@@ -125,7 +125,7 @@ with gr.Blocks(title="Quiz Maker", theme=colorful_theme) as QUIZBOT:
|
|
125 |
gr.Warning('Generating Quiz may take 1-2 minutes. Please wait.', duration=60)
|
126 |
|
127 |
if cross_encoder == '(HIGH ACCURATE) ColBERT':
|
128 |
-
gr.Warning('Retrieving using ColBERT.. First-time query will take
|
129 |
RAG = RAGPretrainedModel.from_pretrained("colbert-ir/colbertv2.0")
|
130 |
RAG_db.value = RAG.from_index('.ragatouille/colbert/indexes/cbseclass10index')
|
131 |
documents_full = RAG_db.value.search(topic, k=top_k_rank)
|
@@ -141,9 +141,9 @@ with gr.Blocks(title="Quiz Maker", theme=colorful_theme) as QUIZBOT:
|
|
141 |
|
142 |
query_doc_pair = [[topic, doc] for doc in documents]
|
143 |
|
144 |
-
if cross_encoder == '(FAST) MiniLM-L6v2':
|
145 |
-
|
146 |
-
|
147 |
cross_encoder1 = CrossEncoder('BAAI/bge-reranker-base')
|
148 |
|
149 |
cross_scores = cross_encoder1.predict(query_doc_pair)
|
|
|
109 |
|
110 |
with gr.Row():
|
111 |
difficulty_radio = gr.Radio(["easy", "average", "hard"], label="How difficult should the quiz be?")
|
112 |
+
model_radio = gr.Radio(choices=[ '(ACCURATE) BGE reranker', '(HIGH ACCURATE) ColBERT'],
|
113 |
value='(ACCURATE) BGE reranker', label="Embeddings",
|
114 |
info="First query to ColBERT may take a little time")
|
115 |
|
|
|
125 |
gr.Warning('Generating Quiz may take 1-2 minutes. Please wait.', duration=60)
|
126 |
|
127 |
if cross_encoder == '(HIGH ACCURATE) ColBERT':
|
128 |
+
gr.Warning('Retrieving using ColBERT.. First-time query will take 2 minute for model to load.. please wait',duration=100)
|
129 |
RAG = RAGPretrainedModel.from_pretrained("colbert-ir/colbertv2.0")
|
130 |
RAG_db.value = RAG.from_index('.ragatouille/colbert/indexes/cbseclass10index')
|
131 |
documents_full = RAG_db.value.search(topic, k=top_k_rank)
|
|
|
141 |
|
142 |
query_doc_pair = [[topic, doc] for doc in documents]
|
143 |
|
144 |
+
# if cross_encoder == '(FAST) MiniLM-L6v2':
|
145 |
+
# cross_encoder1 = CrossEncoder('cross-encoder/ms-marco-MiniLM-L-6-v2')
|
146 |
+
if cross_encoder == '(ACCURATE) BGE reranker':
|
147 |
cross_encoder1 = CrossEncoder('BAAI/bge-reranker-base')
|
148 |
|
149 |
cross_scores = cross_encoder1.predict(query_doc_pair)
|