cdqa-suite / cdQA

⛔ [NOT MAINTAINED] An End-To-End Closed Domain Question Answering System.
https://cdqa-suite.github.io/cdQA-website/
Apache License 2.0
616 stars 191 forks source link

AttributeError while trying to deploy the REST api manually in cdQA #330

Closed SmritiSatyan closed 4 years ago

SmritiSatyan commented 4 years ago

Hi, I am looking to use the cdQA by deplyoing it manually. I followed the steps mentioned in 'https://github.com/cdqa-suite/cdQA' guide. I am getting the below error when I try to run the code flask run -h 0.0.0.0 on the command line.

Traceback (most recent call last): File "c:\users\smriti\appdata\local\programs\python\python37\lib\runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "c:\users\smriti\appdata\local\programs\python\python37\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "C:\Users\smriti\AppData\Local\Programs\Python\Python37\Scripts\flask.exe\__main__.py", line 4, in <module> File "c:\users\smriti\appdata\local\programs\python\python37\lib\site-packages\flask\__init__.py", line 21, in <module> from .app import Flask File "c:\users\smriti\appdata\local\programs\python\python37\lib\site-packages\flask\app.py", line 27, in <module> from werkzeug.routing import BuildError File "C:\Users\smriti\AppData\Roaming\Python\Python37\site-packages\werkzeug\routing.py", line 510, in <module> _IF_KWARGS_URL_ENCODE_AST = _prefix_names(_IF_KWARGS_URL_ENCODE_CODE) File "C:\Users\smriti\AppData\Roaming\Python\Python37\site-packages\werkzeug\routing.py", line 493, in _prefix_names tree = ast.parse(src).body[0] AttributeError: 'code' object has no attribute 'body'

Note: I am using Windows system. Prior to running the 'flask run -h 0.0.0.0' line, I ran the below lines of code without any errors: set dataset_path=path to .csv file set reader_path=path to models\bert_qa.joblib file set FLASK_APP=api.py

SmritiSatyan commented 4 years ago

To get rid of the error, in the ast.py file, the changed the 'parse' function's return statement from return compile(source, filename, mode) to return compile(source, filename, mode,PyCF_ONLY_AST)