Spaces:
Paused
Paused
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 |