ViperX7 / Alpaca-Turbo

Web UI to run alpaca model locally
GNU Affero General Public License v3.0
875 stars 93 forks source link

Unable to Find index.html file on Running Application through Docker Compose Up #40

Open xamelion opened 1 year ago

xamelion commented 1 year ago

Problem Description

Upon running the application through docker compose up, the application is unable to find the index.html file. The following traceback error is generated:

alpaca-turbo-alpaca-1  | Traceback (most recent call last):
alpaca-turbo-alpaca-1  |   File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 2551, in __call__
alpaca-turbo-alpaca-1  |     return self.wsgi_app(environ, start_response)
alpaca-turbo-alpaca-1  |   File "/usr/local/lib/python3.8/site-packages/flask_socketio/__init__.py", line 43, in __call__
alpaca-turbo-alpaca-1  |     return super(_SocketIOMiddleware, self).__call__(environ,
alpaca-turbo-alpaca-1  |   File "/usr/local/lib/python3.8/site-packages/engineio/middleware.py", line 74, in __call__
alpaca-turbo-alpaca-1  |     return self.wsgi_app(environ, start_response)
alpaca-turbo-alpaca-1  |   File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 2531, in wsgi_app
alpaca-turbo-alpaca-1  |     response = self.handle_exception(e)
alpaca-turbo-alpaca-1  |   File "/usr/local/lib/python3.8/site-packages/flask_cors/extension.py", line 165, in wrapped_function
alpaca-turbo-alpaca-1  |     return cors_after_request(app.make_response(f(*args, **kwargs)))
alpaca-turbo-alpaca-1  |   File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 2528, in wsgi_app
alpaca-turbo-alpaca-1  |     response = self.full_dispatch_request()
alpaca-turbo-alpaca-1  |   File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1825, in full_dispatch_request
alpaca-turbo-alpaca-1  |     rv = self.handle_user_exception(e)
alpaca-turbo-alpaca-1  |   File "/usr/local/lib/python3.8/site-packages/flask_cors/extension.py", line 165, in wrapped_function
alpaca-turbo-alpaca-1  |     return cors_after_request(app.make_response(f(*args, **kwargs)))
alpaca-turbo-alpaca-1  |   File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1823, in full_dispatch_request
alpaca-turbo-alpaca-1  |     rv = self.dispatch_request()
alpaca-turbo-alpaca-1  |   File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1799, in dispatch_request
alpaca-turbo-alpaca-1  |     return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
alpaca-turbo-alpaca-1  |   File "/app/api.py", line 218, in index
alpaca-turbo-alpaca-1  |     return render_template("index.html")
alpaca-turbo-alpaca-1  |   File "/usr/local/lib/python3.8/site-packages/flask/templating.py", line 146, in render_template
alpaca-turbo-alpaca-1  |     template = app.jinja_env.get_or_select_template(template_name_or_list)
alpaca-turbo-alpaca-1  |   File "/usr/local/lib/python3.8/site-packages/jinja2/environment.py", line 1081, in get_or_select_template
alpaca-turbo-alpaca-1  |     return self.get_template(template_name_or_list, parent, globals)
alpaca-turbo-alpaca-1  |   File "/usr/local/lib/python3.8/site-packages/jinja2/environment.py", line 1010, in get_template
alpaca-turbo-alpaca-1  |     return self._load_template(name, globals)
alpaca-turbo-alpaca-1  |   File "/usr/local/lib/python3.8/site-packages/jinja2/environment.py", line 969, in _load_template
alpaca-turbo-alpaca-1  |     template = self.loader.load(self, name, self.make_globals(globals))
alpaca-turbo-alpaca-1  |   File "/usr/local/lib/python3.8/site-packages/jinja2/loaders.py", line 126, in load
alpaca-turbo-alpaca-1  |     source, filename, uptodate = self.get_source(environment, name)
alpaca-turbo-alpaca-1  |   File "/usr/local/lib/python3.8/site-packages/flask/templating.py", line 62, in get_source
alpaca-turbo-alpaca-1  |     return self._get_source_fast(environment, template)
alpaca-turbo-alpaca-1  |   File "/usr/local/lib/python3.8/site-packages/flask/templating.py", line 98, in _get_source_fast
alpaca-turbo-alpaca-1  |     raise TemplateNotFound(template)
alpaca-turbo-alpaca-1  | jinja2.exceptions.TemplateNotFound: index.html

Solution

The issue is caused by the application's inability to locate the index.html file. To resolve this issue, please ensure that the index.html file is located in the correct file path and is accessible by the application.

ViperX7 commented 1 year ago

did you clone the git repo

berts83231 commented 1 year ago

I had the same issue. But then saw I need to download the zip instead of clone the repo directly.

TheStoneMX commented 1 year ago

please help, does not for me,

"ensure that the index.html file is located in the correct file path and is accessible by the application."

please explain, as it is located on :

\wsl.localhost\Ubuntu-22.04\home\orangel\alpaca-turbo\Alpaca-Turbo-main\gradio_impl\templates\index.html

Thanks!

espressoelf commented 1 year ago

@TheStoneMX You're not supposed to clone the repository. Download the latest release zip instead.

The expected path is templates\index.html and not gradio_impl\templates\index.html

See #62