mirror of
https://github.com/xtekky/gpt4free.git
synced 2024-12-24 03:23:49 +03:00
Update __init__.py
This commit is contained in:
parent
adffb216cd
commit
a2240a711c
@ -1,16 +1,20 @@
|
||||
from ..errors import MissingRequirementsError
|
||||
|
||||
try:
|
||||
from .server.app import app
|
||||
from .server.website import Website
|
||||
from .server.backend import Backend_Api
|
||||
import_error = None
|
||||
except ImportError as e:
|
||||
import_error = e
|
||||
|
||||
def run_gui(host: str = '0.0.0.0', port: int = 8080, debug: bool = False) -> None:
|
||||
try:
|
||||
from .server.app import app
|
||||
from .server.website import Website
|
||||
from .server.backend import Backend_Api
|
||||
except ImportError:
|
||||
raise MissingRequirementsError('Install "flask" package for the gui')
|
||||
if import_error is not None:
|
||||
raise MissingRequirementsError(f'Install "gui" requirements | pip install g4f[gui] -U\n{import_error}')
|
||||
|
||||
if debug:
|
||||
import g4f
|
||||
g4f.debug.logging = True
|
||||
from g4f import debug
|
||||
debug.logging = True
|
||||
config = {
|
||||
'host' : host,
|
||||
'port' : port,
|
||||
|
Loading…
Reference in New Issue
Block a user