Skip to main content

Python library for easily interacting with trained machine learning models

Project description

gradio_xterm_logger

Static Badge

Python library for easily interacting with trained machine learning models

Installation

pip install gradio_xterm_logger

Usage

import gradio as gr
from gradio_xterm_logger import GradioXtermLogger


with gr.Blocks() as demo:
    terminal_a = GradioXtermLogger(
        label="Terminal Output (Custom Log File)",
        log_path="inference_log.log",
        font_size=12,
        dark_mode=True,
        every=0.5
    )

    terminal_b = GradioXtermLogger(
        label="Terminal Output (Current Terminal)",
        show_current_terminal=True,
        font_size=12,
        dark_mode=False,
        every=0.5
    )

if __name__ == "__main__":
    demo.launch()

GradioXtermLogger

Initialization

name type default description
log_path
str | None
None None
dark_mode
bool
True None
font_size
int
12 None
show_current_terminal
bool
False None
n_lines
int
40 None
label
str | None
None None
info
str | None
None None
show_label
bool | None
None None
container
bool
True None
scale
int | None
None None
min_width
int | None
None None
interactive
bool | None
None None
visible
bool
True None
elem_id
str | None
None None
elem_classes
list[str] | str | None
None None
render
bool
True None
load_fn
typing.Optional[typing.Callable[..., typing.Any]][
    typing.Callable[..., typing.Any][Ellipsis, Any], None
]
None None
every
float | None
0.5 None

User function

The impact on the users predict function varies depending on whether the component is used as an input or output for an event (or both).

  • When used as an Input, the component only impacts the input signature of the user function.
  • When used as an output, the component only impacts the return signature of the user function.

The code snippet below is accurate in cases where the component is used as both an input and an output.

  • As output: Is passed, the preprocessed input data sent to the user's function in the backend.
  • As input: Should return, the output data received by the component from the user's function in the backend.
def predict(
    value: Any
) -> Any:
    return value

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gradio_xterm_logger-0.0.2.tar.gz (1.2 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gradio_xterm_logger-0.0.2-py3-none-any.whl (1.2 MB view details)

Uploaded Python 3

File details

Details for the file gradio_xterm_logger-0.0.2.tar.gz.

File metadata

  • Download URL: gradio_xterm_logger-0.0.2.tar.gz
  • Upload date:
  • Size: 1.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.10

File hashes

Hashes for gradio_xterm_logger-0.0.2.tar.gz
Algorithm Hash digest
SHA256 00ec800cbf2fc40f6e3d9ca1e534db9ca5ffbe9efd0cb9520c85963dbe039623
MD5 842b3aed24b67860b42a37ae5b003ab8
BLAKE2b-256 063d77114054e460ff49fbe4b26492a8f47836802ffad4b3d72ef1bfd9139508

See more details on using hashes here.

File details

Details for the file gradio_xterm_logger-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for gradio_xterm_logger-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ecaf457da9a28ba3c6c23160f87843d26be56bf19c999278a2f15cffd25fdf60
MD5 b5c5869eafc7bbe13d2b3b002e99e58e
BLAKE2b-256 b80dea3a168f1f70d4c0ee18c0e88b7319e52b87d010c2d34dfe6c1505f9593e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page