Spaces:
Sleeping
Sleeping
Update genra_incremental.py
Browse files- genra_incremental.py +3 -3
genra_incremental.py
CHANGED
|
@@ -28,7 +28,7 @@ class LLMGenerator:
|
|
| 28 |
self.tokenizer = tokenizer
|
| 29 |
self.llm_name = llm_name
|
| 30 |
|
| 31 |
-
@spaces.GPU(duration=
|
| 32 |
def generate_answer(self, texts, query, mode='validate'):
|
| 33 |
template_texts =""
|
| 34 |
for i, text in enumerate(texts):
|
|
@@ -64,7 +64,7 @@ class LLMGenerator:
|
|
| 64 |
|
| 65 |
|
| 66 |
class QAIndexer:
|
| 67 |
-
@spaces.GPU(duration=
|
| 68 |
def __init__(self, index_type, emb_model):
|
| 69 |
self.document_embedder = SentenceTransformersDocumentEmbedder(model=emb_model)
|
| 70 |
self.document_embedder.warm_up()
|
|
@@ -129,7 +129,7 @@ def rank_aggregation(aggregator, lists, k):
|
|
| 129 |
|
| 130 |
|
| 131 |
class GenraPipeline:
|
| 132 |
-
@spaces.GPU(duration=
|
| 133 |
def __init__(self, llm_name, emb_model, aggregator, contexts):
|
| 134 |
self.qa_indexer = QAIndexer('in_memory', emb_model)
|
| 135 |
self.qa_retriever = QARetriever(self.qa_indexer.document_store)
|
|
|
|
| 28 |
self.tokenizer = tokenizer
|
| 29 |
self.llm_name = llm_name
|
| 30 |
|
| 31 |
+
@spaces.GPU(duration=1000)
|
| 32 |
def generate_answer(self, texts, query, mode='validate'):
|
| 33 |
template_texts =""
|
| 34 |
for i, text in enumerate(texts):
|
|
|
|
| 64 |
|
| 65 |
|
| 66 |
class QAIndexer:
|
| 67 |
+
@spaces.GPU(duration=1000)
|
| 68 |
def __init__(self, index_type, emb_model):
|
| 69 |
self.document_embedder = SentenceTransformersDocumentEmbedder(model=emb_model)
|
| 70 |
self.document_embedder.warm_up()
|
|
|
|
| 129 |
|
| 130 |
|
| 131 |
class GenraPipeline:
|
| 132 |
+
@spaces.GPU(duration=1000)
|
| 133 |
def __init__(self, llm_name, emb_model, aggregator, contexts):
|
| 134 |
self.qa_indexer = QAIndexer('in_memory', emb_model)
|
| 135 |
self.qa_retriever = QARetriever(self.qa_indexer.document_store)
|