Spaces:
Build error
Build error
zhenyundeng
commited on
Commit
·
b2b4955
1
Parent(s):
a144627
update
Browse files
app.py
CHANGED
|
@@ -881,15 +881,6 @@ def triple_to_string(x):
|
|
| 881 |
|
| 882 |
@spaces.GPU
|
| 883 |
def rerank_questions(claim, bm25_qas, topk=3):
|
| 884 |
-
#
|
| 885 |
-
# tokenizer = BertTokenizer.from_pretrained("bert-base-uncased")
|
| 886 |
-
# bert_model = BertForSequenceClassification.from_pretrained("bert-base-uncased", num_labels=2,
|
| 887 |
-
# problem_type="single_label_classification") # Must specify single_label for some reason
|
| 888 |
-
# best_checkpoint = "averitec/pretrained_models/bert_dual_encoder.ckpt"
|
| 889 |
-
# device = "cuda:0" if torch.cuda.is_available() else "cpu"
|
| 890 |
-
# trained_model = DualEncoderModule.load_from_checkpoint(best_checkpoint, tokenizer=tokenizer, model=bert_model).to(
|
| 891 |
-
# device)
|
| 892 |
-
|
| 893 |
#
|
| 894 |
strs_to_score = []
|
| 895 |
values = []
|
|
@@ -919,7 +910,7 @@ def rerank_questions(claim, bm25_qas, topk=3):
|
|
| 919 |
return top3_qa_pairs
|
| 920 |
|
| 921 |
|
| 922 |
-
|
| 923 |
def Googleretriever(query, sources):
|
| 924 |
# ----- Generate QA pairs using AVeriTeC
|
| 925 |
# step 1: generate questions for the query/claim using Bloom
|
|
@@ -1246,6 +1237,7 @@ def log_on_azure(file, logs, azure_share_client):
|
|
| 1246 |
file_client.upload_file(logs)
|
| 1247 |
|
| 1248 |
|
|
|
|
| 1249 |
def chat(claim, history, sources):
|
| 1250 |
evidence = []
|
| 1251 |
if 'Google' in sources:
|
|
|
|
| 881 |
|
| 882 |
@spaces.GPU
|
| 883 |
def rerank_questions(claim, bm25_qas, topk=3):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 884 |
#
|
| 885 |
strs_to_score = []
|
| 886 |
values = []
|
|
|
|
| 910 |
return top3_qa_pairs
|
| 911 |
|
| 912 |
|
| 913 |
+
@spaces.GPU
|
| 914 |
def Googleretriever(query, sources):
|
| 915 |
# ----- Generate QA pairs using AVeriTeC
|
| 916 |
# step 1: generate questions for the query/claim using Bloom
|
|
|
|
| 1237 |
file_client.upload_file(logs)
|
| 1238 |
|
| 1239 |
|
| 1240 |
+
@spaces.GPU
|
| 1241 |
def chat(claim, history, sources):
|
| 1242 |
evidence = []
|
| 1243 |
if 'Google' in sources:
|