summaryrefslogtreecommitdiffstats
path: root/g4f
diff options
context:
space:
mode:
authorHeiner Lohaus <hlohaus@users.noreply.github.com>2023-12-11 02:50:33 +0100
committerHeiner Lohaus <hlohaus@users.noreply.github.com>2023-12-11 02:50:33 +0100
commitb2d02ed624f9354214228c3f4d5dcb1a74d792b3 (patch)
tree9b25c40faba70070869d5a260fabe7610e780435 /g4f
parentAdd error classes (diff)
downloadgpt4free-b2d02ed624f9354214228c3f4d5dcb1a74d792b3.tar
gpt4free-b2d02ed624f9354214228c3f4d5dcb1a74d792b3.tar.gz
gpt4free-b2d02ed624f9354214228c3f4d5dcb1a74d792b3.tar.bz2
gpt4free-b2d02ed624f9354214228c3f4d5dcb1a74d792b3.tar.lz
gpt4free-b2d02ed624f9354214228c3f4d5dcb1a74d792b3.tar.xz
gpt4free-b2d02ed624f9354214228c3f4d5dcb1a74d792b3.tar.zst
gpt4free-b2d02ed624f9354214228c3f4d5dcb1a74d792b3.zip
Diffstat (limited to '')
-rw-r--r--g4f/cli.py2
-rw-r--r--g4f/debug.py10
-rw-r--r--g4f/gui/run.py2
3 files changed, 7 insertions, 7 deletions
diff --git a/g4f/cli.py b/g4f/cli.py
index 20131e5d..40ddd3d7 100644
--- a/g4f/cli.py
+++ b/g4f/cli.py
@@ -15,7 +15,7 @@ def main():
parser = argparse.ArgumentParser(description="Run gpt4free")
subparsers = parser.add_subparsers(dest="mode", help="Mode to run the g4f in.")
api_parser=subparsers.add_parser("api")
- api_parser.add_argument("--bind", default="127.0.0.1:1337", help="The bind string.")
+ api_parser.add_argument("--bind", default="0.0.0.0:1337", help="The bind string.")
api_parser.add_argument("--debug", type=bool, default=False, help="Enable verbose logging")
api_parser.add_argument("--ignored-providers", nargs="+", choices=[provider.name for provider in IgnoredProviders],
default=[], help="List of providers to ignore when processing request.")
diff --git a/g4f/debug.py b/g4f/debug.py
index 85009277..1ee1506f 100644
--- a/g4f/debug.py
+++ b/g4f/debug.py
@@ -1,6 +1,6 @@
from os import environ
from requests import get
-from importlib.metadata import version, PackageNotFoundError
+from importlib.metadata import version as get_package_version, PackageNotFoundError
from subprocess import check_output, CalledProcessError, PIPE
from .errors import VersionNotFoundError
@@ -10,7 +10,7 @@ version_check = True
def get_version() -> str:
# Read from package manager
try:
- return version("g4f")
+ return get_package_version("g4f")
except PackageNotFoundError:
pass
# Read from docker environment
@@ -33,7 +33,7 @@ def check_pypi_version() -> None:
try:
version = get_version()
latest_version = get_lastet_version()
+ if version != latest_version:
+ print(f'New pypi version: {latest_version} (current: {version}) | pip install -U g4f')
except Exception as e:
- print(f'Failed to check g4f pypi version: {e}')
- if version != latest_version:
- print(f'New pypi version: {latest_version} (current: {version}) | pip install -U g4f') \ No newline at end of file
+ print(f'Failed to check g4f pypi version: {e}') \ No newline at end of file
diff --git a/g4f/gui/run.py b/g4f/gui/run.py
index 0f94814c..7ff769fd 100644
--- a/g4f/gui/run.py
+++ b/g4f/gui/run.py
@@ -6,7 +6,7 @@ from g4f.gui import run_gui
def gui_parser():
parser = ArgumentParser(description="Run the GUI")
parser.add_argument("-host", type=str, default="0.0.0.0", help="hostname")
- parser.add_argument("-port", type=int, default=80, help="port")
+ parser.add_argument("-port", type=int, default=8080, help="port")
parser.add_argument("-debug", action="store_true", help="debug mode")
return parser