Spaces:
Build error
Build error
consciousAI
commited on
Commit
·
ab6d9a9
1
Parent(s):
6d891ac
Update app.py
Browse files
app.py
CHANGED
@@ -40,7 +40,7 @@ def predict(query, context):
|
|
40 |
context = context.decode()
|
41 |
|
42 |
#Custom1
|
43 |
-
cust_model_name = "
|
44 |
cust_question_answerer = pipeline('question-answering', model=cust_model_name, tokenizer=cust_model_name, device=device)
|
45 |
|
46 |
cust_output = cust_question_answerer(question=query, context=context)
|
@@ -54,7 +54,7 @@ def predict(query, context):
|
|
54 |
cust_answer_sentence = "Failed matching sentence (answer may be split in multiple sentences)"
|
55 |
|
56 |
#Custom2
|
57 |
-
cust_answer_2 = _generate(query, context, model="
|
58 |
cust_answer_sentence_2 = [_sent for _sent in sent_tokenize(context) if cust_answer_2 in _sent]
|
59 |
if len(cust_answer_sentence_2) > 0:
|
60 |
cust_answer_sentence_2 = cust_answer_sentence_2[0]
|
|
|
40 |
context = context.decode()
|
41 |
|
42 |
#Custom1
|
43 |
+
cust_model_name = "consciousAI/question-answering-roberta-base-s"
|
44 |
cust_question_answerer = pipeline('question-answering', model=cust_model_name, tokenizer=cust_model_name, device=device)
|
45 |
|
46 |
cust_output = cust_question_answerer(question=query, context=context)
|
|
|
54 |
cust_answer_sentence = "Failed matching sentence (answer may be split in multiple sentences)"
|
55 |
|
56 |
#Custom2
|
57 |
+
cust_answer_2 = _generate(query, context, model="consciousAI/question-answering-generative-t5-v1-base-s-q-c", device=device)
|
58 |
cust_answer_sentence_2 = [_sent for _sent in sent_tokenize(context) if cust_answer_2 in _sent]
|
59 |
if len(cust_answer_sentence_2) > 0:
|
60 |
cust_answer_sentence_2 = cust_answer_sentence_2[0]
|