Spaces:
Paused
Paused
File size: 344 Bytes
dcf6f0c 0fdee06 dcf6f0c |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
import json
import datetime
def get_answer(input, context, engine):
answer = engine({"question": input, "context": context})
return answer["answer"]
def get_context():
now = datetime.datetime.now()
with open("context.json") as f:
context = json.load(f)["info"].replace("[YEAR]", str(now.year))
return context |