From ab04d1d8943557e41191241686c10d5aa89bddd3 Mon Sep 17 00:00:00 2001 From: hlohaus <983577+hlohaus@users.noreply.github.com> Date: Sun, 26 Jan 2025 02:48:43 +0100 Subject: Increase max token in HuggingfaceAPI Restore browser instance on start up errors in nodriver Restored instances can be used as usual or to stop the browser Add demo modus to web ui for HuggingSpace Add rate limit support to web ui. Simply install flask_limiter Add home for demo with Access Token input and validation Add stripped model list for demo Add ignores for encoding error in web_search and file upload --- g4f/gui/server/website.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'g4f/gui/server/website.py') diff --git a/g4f/gui/server/website.py b/g4f/gui/server/website.py index 1af8aa08..76ca4438 100644 --- a/g4f/gui/server/website.py +++ b/g4f/gui/server/website.py @@ -9,7 +9,7 @@ class Website: self.app = app self.routes = { '/': { - 'function': self._home, + 'function': self._demo if app.demo else self._home, 'methods': ['GET', 'POST'] }, '/chat/': { @@ -43,4 +43,7 @@ class Website: return render_template('index.html', chat_id=str(uuid.uuid4())) def _home(self): - return render_template('home.html') \ No newline at end of file + return render_template('home.html') + + def _demo(self): + return render_template('demo.html') \ No newline at end of file -- cgit v1.2.3