From 5cb6dba8862058e2ed6ca13a9cac0480abf9c29d Mon Sep 17 00:00:00 2001 From: Beppe Date: Wed, 30 Nov 2022 14:59:29 +0100 Subject: [PATCH] cleanup --- main.py | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/main.py b/main.py index da80b57..b8c13a2 100644 --- a/main.py +++ b/main.py @@ -14,14 +14,6 @@ config = { class Root(object): - - - def answer_question(self, question, context): - question_answerer = pipeline('question-answering', model=model_name, tokenizer=model_name) - answer = question_answerer({'question': question, 'context': context}) - print(answer) - return answer["answer"] - @cherrypy.expose def index(self, *args, **kwargs): answer = "" @@ -36,15 +28,7 @@ class Root(object): answer = "

answer

{}

".format(temp["answer"]) return "reinout project 1

question

{}".format(answer) - - @cherrypy.expose - def question(self, *args,**kwargs): - with open('data.txt') as f: - alles = f.read() - f.close() - string=self.answer_question(cherrypy.request.params.get('the_link'), alles) - return string - + if __name__ == '__main__': cherrypy.quickstart(Root(), '/', config)