Skip to content

gui

Automatically generated README for this automation recipe: gui

Category: GUI

License: Apache 2.0

Developers: Grigori Fursin


This CM script provides a unified GUI to run CM scripts using Streamlit library.

If you want to run it in a cloud (Azure, AWS, GCP), you need to open some port and test that you can reach it from outside.

By default, streamlit uses port 8501 but you can change it as follows:

cm run script "cm gui" --port 80

If you have troubles accessing this port, use this simple python module to test if your port is open:

python3 -m http.server 80

  • CM meta description for this script: _cm.yaml
  • Output cached? False

Reuse this script in your project

Install MLCommons CM automation meta-framework

Pull CM repository with this automation recipe (CM script)

cm pull repo mlcommons@cm4mlops

cmr "cm gui cm-gui script-gui cm-script-gui streamlit" --help

Run this script

Run this script via CLI
cm run script --tags=cm,gui,cm-gui,script-gui,cm-script-gui,streamlit[,variations] [--input_flags]
Run this script via CLI (alternative)
cmr "cm gui cm-gui script-gui cm-script-gui streamlit [variations]" [--input_flags]
Run this script from Python
import cmind

r = cmind.access({'action':'run'
              'automation':'script',
              'tags':'cm,gui,cm-gui,script-gui,cm-script-gui,streamlit'
              'out':'con',
              ...
              (other input keys for this script)
              ...
             })

if r['return']>0:
    print (r['error'])
Run this script via Docker (beta)
cm docker script "cm gui cm-gui script-gui cm-script-gui streamlit[variations]" [--input_flags]

Variations

  • Group "app"

    Click here to expand this section.

    • _chatgpt
      • ENV variables:
        • CM_GUI_APP: chatgpt
    • _graph
      • ENV variables:
        • CM_GUI_APP: graph
    • _main
      • ENV variables:
        • CM_GUI_APP: app
    • _playground
      • ENV variables:
        • CM_GUI_APP: playground

Input Flags

  • --script: script tags
  • --app: gui app

Script flags mapped to environment

  • --address=valueCM_GUI_ADDRESS=value
  • --app=valueCM_GUI_APP=value
  • --exp_key_c=valueCM_GUI_GRAPH_EXPERIMENT_AXIS_KEY_C=value
  • --exp_key_s=valueCM_GUI_GRAPH_EXPERIMENT_AXIS_KEY_S=value
  • --exp_key_x=valueCM_GUI_GRAPH_EXPERIMENT_AXIS_KEY_X=value
  • --exp_key_y=valueCM_GUI_GRAPH_EXPERIMENT_AXIS_KEY_Y=value
  • --exp_max_results=valueCM_GUI_GRAPH_EXPERIMENT_MAX_RESULTS=value
  • --exp_name=valueCM_GUI_GRAPH_EXPERIMENT_NAME=value
  • --exp_tags=valueCM_GUI_GRAPH_EXPERIMENT_TAGS=value
  • --exp_title=valueCM_GUI_GRAPH_EXPERIMENT_TITLE=value
  • --exp_uid=valueCM_GUI_GRAPH_EXPERIMENT_RESULT_UID=value
  • --no_browser=valueCM_GUI_NO_BROWSER=value
  • --no_run=valueCM_GUI_NO_RUN=value
  • --port=valueCM_GUI_PORT=value
  • --prefix=valueCM_GUI_SCRIPT_PREFIX_LINUX=value
  • --script=valueCM_GUI_SCRIPT_TAGS=value
  • --title=valueCM_GUI_TITLE=value

Default environment

These keys can be updated via --env.KEY=VALUE or env dictionary in @input.json or using script flags.

  • CM_GUI_EXTRA_CMD: ``
  • CM_GUI_SCRIPT_PREFIX_LINUX: gnome-terminal --
  • CM_GUI_APP: app

Native script being run


Script output

cmr "cm gui cm-gui script-gui cm-script-gui streamlit [variations]" [--input_flags] -j