mirror of
https://github.com/gradio-app/gradio.git
synced 2024-11-27 01:40:20 +08:00
Fix type of server returned by Launchable
(#810)
* `Launchable` returns a FastAPI now * Update .gitignore
This commit is contained in:
parent
79505ba76d
commit
94fac2e3df
1
.gitignore
vendored
1
.gitignore
vendored
@ -38,6 +38,7 @@ demo/files/*.mp4
|
||||
*.bak
|
||||
workspace.code-workspace
|
||||
*.h5
|
||||
.vscode/
|
||||
|
||||
# log files
|
||||
.pnpm-debug.log
|
@ -31,7 +31,6 @@ from gradio.process_examples import load_from_cache, process_example
|
||||
from gradio.routes import PredictBody
|
||||
|
||||
if TYPE_CHECKING: # Only import for type checking (is False at runtime).
|
||||
import flask
|
||||
import transformers
|
||||
|
||||
|
||||
|
@ -11,7 +11,7 @@ from gradio import encryptor, networking, queueing, strings, utils # type: igno
|
||||
from gradio.process_examples import cache_interface_examples
|
||||
|
||||
if TYPE_CHECKING: # Only import for type checking (is False at runtime).
|
||||
import flask
|
||||
import fastapi
|
||||
|
||||
|
||||
class Launchable:
|
||||
@ -42,7 +42,7 @@ class Launchable:
|
||||
ssl_keyfile: Optional[str] = None,
|
||||
ssl_certfile: Optional[str] = None,
|
||||
ssl_keyfile_password: Optional[str] = None,
|
||||
) -> Tuple[flask.Flask, str, str]:
|
||||
) -> Tuple[fastapi.FastAPI, str, str]:
|
||||
"""
|
||||
Launches the webserver that serves the UI for the interface.
|
||||
Parameters:
|
||||
@ -68,7 +68,7 @@ class Launchable:
|
||||
ssl_certfile (str): If a path to a file is provided, will use this as the signed certificate for https. Needs to be provided if ssl_keyfile is provided.
|
||||
ssl_keyfile_password (str): If a password is provided, will use this with the ssl certificate for https.
|
||||
Returns:
|
||||
app (flask.Flask): Flask app object
|
||||
app (fastapi.FastAPI): FastAPI app object
|
||||
path_to_local_server (str): Locally accessible link
|
||||
share_url (str): Publicly accessible link (if share=True)
|
||||
"""
|
||||
|
Loading…
Reference in New Issue
Block a user