Spaces:
Sleeping
Sleeping
George Tsang
commited on
Commit
·
ddaafa1
1
Parent(s):
ba7c1a8
fix invalid non-printable character
Browse files
app.py
CHANGED
@@ -6,9 +6,9 @@ mdl_name = "distilbert-base-cased-distilled-squad"
|
|
6 |
my_pipeline = pipeline('question-answering', model=mdl_name, tokenizer=mdl_name)
|
7 |
|
8 |
def answer_question(question,context):
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
|
14 |
grad.Interface(answer_question, inputs=["text","text"], outputs="text").launch()
|
|
|
6 |
my_pipeline = pipeline('question-answering', model=mdl_name, tokenizer=mdl_name)
|
7 |
|
8 |
def answer_question(question,context):
|
9 |
+
text= "{"+"'question': '"+question+"','context': '"+context+"'}"
|
10 |
+
di=ast.literal_eval(text)
|
11 |
+
response = my_pipeline(di)
|
12 |
+
return response
|
13 |
|
14 |
grad.Interface(answer_question, inputs=["text","text"], outputs="text").launch()
|