repo stringclasses 13
values | version stringclasses 48
values | file_path stringlengths 6 175 | content stringlengths 10 4.56M | content_hash stringlengths 12 12 | line_count int64 1 140k | char_count int64 10 4.56M |
|---|---|---|---|---|---|---|
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/__about__.py | # Copyright The Lightning AI team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | 1a00560b414f | 41 | 1,285 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/__init__.py | """Root package info."""
import logging
import sys
# explicitly don't set root logger's propagation and leave this to subpackages to manage
_logger = logging.getLogger(__name__)
_logger.setLevel(logging.INFO)
_console = logging.StreamHandler()
_console.setLevel(logging.INFO)
formatter = logging.Formatter("%(levelna... | 6803aea5e2b8 | 50 | 1,511 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/__main__.py | from lightning.app.cli.lightning_cli import main
if __name__ == "__main__":
main()
| 909f7e252741 | 5 | 88 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/__setup__.py | import glob
import os.path
from importlib.util import module_from_spec, spec_from_file_location
from pathlib import Path
from types import ModuleType
from typing import Any, Dict
from setuptools import find_packages
_PROJECT_ROOT = "."
_SOURCE_ROOT = os.path.join(_PROJECT_ROOT, "src")
_PACKAGE_ROOT = os.path.join(_SO... | e9c8591efae7 | 148 | 6,830 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/__version__.py | import os
_PACKAGE_ROOT = os.path.dirname(__file__)
_VERSION_PATH = os.path.join(os.path.dirname(_PACKAGE_ROOT), "version.info")
if not os.path.exists(_VERSION_PATH):
# relevant for `bdist_wheel`
_VERSION_PATH = os.path.join(_PACKAGE_ROOT, "version.info")
with open(_VERSION_PATH, encoding="utf-8") as fo:
v... | 1ccf9b9f029c | 10 | 355 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/CHANGELOG.md | # Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
## [2.2.0] - 2024-02-09
## Changed
- Renames the `lightning` cli to `lightning_app` ([#19440](https://github.com/Lightning-AI/pytorch-lightning/pull/19440... | b716a29c0851 | 609 | 37,365 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/__init__.py | """Root package info."""
import logging
import os
from lightning_utilities.core.imports import module_available, package_available
_root_logger = logging.getLogger()
_logger = logging.getLogger(__name__)
_logger.setLevel(logging.INFO)
_console = logging.StreamHandler()
_console.setLevel(logging.INFO)
formatter = l... | 02c287fe8cda | 52 | 1,989 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/api/__init__.py | from lightning.app.api.http_methods import Delete, Get, Post, Put
__all__ = [
"Delete",
"Get",
"Post",
"Put",
]
| ca9425eaa00a | 9 | 129 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/api/http_methods.py | # Copyright The Lightning AI team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | 8349d6bf5283 | 259 | 8,715 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/api/request_types.py | # Copyright The Lightning AI team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | 013b5e3e0114 | 57 | 1,250 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/cli/cmd_apps.py | # Copyright The Lightning AI team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | 98f42954c2e7 | 147 | 5,745 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/cli/cmd_init.py | # Copyright The Lightning AI team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | ece8c97a2e06 | 168 | 5,286 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/cli/cmd_install.py | # Copyright The Lightning AI team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | 3d2b4b6311a6 | 658 | 21,201 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/cli/cmd_pl_init.py | # Copyright The Lightning AI team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | 90aca69adbf4 | 188 | 6,740 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/cli/cmd_react_ui_init.py | # Copyright The Lightning AI team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | 5ead2866bf46 | 132 | 4,342 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/cli/core.py | # Copyright The Lightning AI team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | ff82620fbc33 | 28 | 790 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/cli/lightning_cli.py | # Copyright The Lightning AI team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | 6baba330467b | 504 | 16,858 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/cli/lightning_cli_delete.py | # Copyright The Lightning AI team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | 0002f6debb2c | 125 | 4,323 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/cli/lightning_cli_launch.py | # Copyright The Lightning AI team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | 626d03888fa4 | 131 | 5,063 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/cli/lightning_cli_list.py | # Copyright The Lightning AI team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | 9c30dd7d0fae | 33 | 955 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/cli/app-template/README.md | # placeholdername app
This ⚡ [Lightning app](https://lightning.ai/) ⚡ was generated automatically with:
```bash
lightning_app init app placeholdername
```
## To run placeholdername
First, install placeholdername (warning: this app has not been officially approved on the lightning gallery):
```bash
lightning_app in... | 014477a6cf55 | 38 | 814 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/cli/app-template/app.py | from lightning.app import LightningApp, LightningFlow
from placeholdername import ComponentA, ComponentB
class LitApp(LightningFlow):
def __init__(self) -> None:
super().__init__()
self.component_a = ComponentA()
self.component_b = ComponentB()
def run(self):
self.component_a.... | 2cc3ab252f2d | 17 | 388 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/cli/app-template/setup.py | #!/usr/bin/env python
from setuptools import find_packages, setup
setup(
name="placeholdername",
version="0.0.0",
description="⚡ Lightning app ⚡ generated with command: lightning init app",
author="",
author_email="",
# REPLACE WITH YOUR OWN GITHUB PROJECT LINK
url="https://github.com/Ligh... | e7cc92c3d5b1 | 16 | 411 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/cli/app-template/placeholdername/__init__.py | from placeholdername.components.component_a import ComponentA
from placeholdername.components.component_b import ComponentB
__all__ = ["ComponentA", "ComponentB"]
| 84d531fbc8aa | 5 | 164 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/cli/app-template/placeholdername/components/component_a/__init__.py | from placeholdername.components.component_a.component_a import ComponentA
__all__ = ["ComponentA"]
| b47bcc26781a | 4 | 100 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/cli/app-template/placeholdername/components/component_a/component_a.py | from lightning.app import LightningFlow
class ComponentA(LightningFlow):
def run(self):
print("hello from component A")
| 9bf0812496d7 | 7 | 134 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/cli/app-template/placeholdername/components/component_b/__init__.py | from placeholdername.components.component_b.component_a import ComponentB
__all__ = ["ComponentB"]
| c1d9c3d225f8 | 4 | 100 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/cli/app-template/placeholdername/components/component_b/component_a.py | from lightning.app import LightningFlow
class ComponentB(LightningFlow):
def run(self):
print("hello from component B")
| 9733bcb7d7a7 | 7 | 134 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/cli/commands/app_commands.py | # Copyright The Lightning AI team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | f1c88db95860 | 136 | 5,051 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/cli/commands/cd.py | # Copyright The Lightning AI team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | fe3c9251f499 | 118 | 3,788 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/cli/commands/cp.py | # Copyright The Lightning AI team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | 0f4135e911e4 | 351 | 12,590 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/cli/commands/logs.py | # Copyright The Lightning AI team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | cac02c8c02dc | 123 | 4,290 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/cli/commands/ls.py | # Copyright The Lightning AI team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | b9cfa4871ebb | 269 | 9,486 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/cli/commands/pwd.py | # Copyright The Lightning AI team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | eaa2f4d1a09b | 54 | 1,488 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/cli/commands/rm.py | # Copyright The Lightning AI team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | fa1f44a20816 | 102 | 3,749 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/cli/component-template/README.md | # placeholdername component
This ⚡ [Lightning component](https://lightning.ai/) ⚡ was generated automatically with:
```bash
lightning_app init component placeholdername
```
## To run placeholdername
First, install placeholdername (warning: this component has not been officially approved on the lightning gallery):
... | 0cd304e43ea0 | 36 | 863 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/cli/component-template/app.py | from lightning.app import LightningApp, LightningFlow
from placeholdername import TemplateComponent
class LitApp(LightningFlow):
def __init__(self) -> None:
super().__init__()
self.placeholdername = TemplateComponent()
def run(self):
print("this is a simple Lightning app to verify you... | 26eba908f1af | 16 | 423 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/cli/component-template/setup.py | #!/usr/bin/env python
from setuptools import find_packages, setup
setup(
name="placeholdername",
version="0.0.0",
description="⚡ Lightning component ⚡ generated with command: lightning_app init component",
author="",
author_email="",
# REPLACE WITH YOUR OWN GITHUB PROJECT LINK
url="https:/... | 8032d2fbcd56 | 16 | 433 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/cli/component-template/placeholdername/__init__.py | from placeholdername.component import TemplateComponent
__all__ = ["TemplateComponent"]
| c10a5cb925dc | 4 | 89 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/cli/component-template/placeholdername/component.py | from lightning.app import LightningWork
class TemplateComponent(LightningWork):
def __init__(self) -> None:
super().__init__()
self.value = 0
def run(self):
self.value += 1
print("welcome to your work component")
print("this is running inside a work")
| 9330739a4bb3 | 13 | 303 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/cli/connect/app.py | # Copyright The Lightning AI team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | 2ea36e44c159 | 388 | 14,428 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/cli/connect/data.py | # Copyright The Lightning team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | 0be337c9ff57 | 110 | 3,936 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/cli/pl-app-template/app.py | import os
from typing import Dict, List, Optional, Union
from core.components import TensorBoard, WeightsAndBiases
from core.components.script_runner import ScriptRunner
from lightning.app import LightningApp, LightningFlow
from lightning.app.frontend import StaticWebFrontend
from lightning.app.storage.path import Pat... | 486521e522d8 | 106 | 4,291 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/cli/pl-app-template/setup.py | import os
from typing import List
from setuptools import find_packages, setup
_PROJECT_ROOT = os.path.dirname(__file__)
def _load_requirements(path_dir: str, file_name: str = "requirements.txt", comment_char: str = "#") -> List[str]:
"""Load requirements from a file."""
with open(os.path.join(path_dir, file... | 154838279b98 | 35 | 959 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/cli/pl-app-template/core/callbacks.py | import inspect
from typing import TYPE_CHECKING, Any, Dict, Union
import lightning.pytorch as pl
from lightning.app.storage.path import Path
from lightning.app.utilities.app_helpers import Logger
from lightning.pytorch import Callback
from lightning.pytorch.callbacks.progress.progress_bar import get_standard_metrics
f... | ce5a58b221cf | 320 | 13,037 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/cli/pl-app-template/core/state.py | from typing import Dict, Optional, Union
from pydantic import BaseModel, Field
class FitProgress(BaseModel):
current_epoch: int = 0
train_batch_idx: int = 0
total_train_batches: int = 0
val_dataloader_idx: int = 0
val_batch_idx: int = 0
total_val_batches: int = 0
global_step: int = 0
... | b6c2142173b8 | 46 | 1,183 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/cli/pl-app-template/core/components/__init__.py | from core.components.logger.tensorboard import TensorBoard # noqa: F401
from core.components.logger.weights_and_biases import WeightsAndBiases # noqa: F401
| 0a92bbf477be | 3 | 158 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/cli/pl-app-template/core/components/logger/tensorboard.py | import subprocess
import time
from typing import Dict, List
from lightning.app import BuildConfig, LightningFlow, LightningWork
from lightning.app.storage.path import Path
class TensorBoard(LightningFlow):
def __init__(self, log_dir: Path, sync_every_n_seconds: int = 5) -> None:
"""This TensorBoard compo... | c81b354fa3b3 | 50 | 1,694 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/cli/pl-app-template/core/components/logger/weights_and_biases.py | import os
from typing import TYPE_CHECKING, Dict, List, Optional
from lightning.app import LightningFlow
if TYPE_CHECKING:
import wandb
class WeightsAndBiases(LightningFlow):
def __init__(self, username: str, project_name: str, run_id: str, api_key: Optional[str] = None) -> None:
super().__init__()
... | bf0eec153d2f | 34 | 972 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/cli/pl-app-template/core/components/script_runner/__init__.py | from core.components.script_runner.script_runner import ScriptRunner # noqa: F401
| 352c3083a3d4 | 2 | 83 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/cli/pl-app-template/core/components/script_runner/script_runner.py | import sys
import traceback
from typing import Any, Dict, List, Optional, Tuple
from lightning.app.components.python import TracerPythonScript
from lightning.app.storage.path import Path
from lightning.app.utilities.packaging.build_config import BuildConfig, load_requirements
from lightning.app.utilities.tracer import... | 20110190fcc5 | 77 | 3,148 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/cli/pl-app-template/ui/craco.config.js | const path = require("path");
const fs = require("fs");
const cracoBabelLoader = require("craco-babel-loader");
// manage relative paths to packages
const appDirectory = fs.realpathSync(process.cwd());
const resolvePackage = relativePath => path.resolve(appDirectory, relativePath);
module.exports = {
devServer: {
... | 0466c2b69200 | 30 | 696 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/cli/pl-app-template/ui/package.json | {
"name": "pytorch-lightning-app",
"version": "0.1.0",
"private": true,
"dependencies": {
"@emotion/react": "^11.7.1",
"@emotion/styled": "^11.6.0",
"@mui/icons-material": "^5.6.2",
"@mui/lab": "^5.0.0-alpha.64",
"@mui/material": "^5.2.7",
"@reduxjs/toolkit": "^1.8.0",
"@stripe/strip... | 5de6fcb60d0d | 96 | 2,549 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/cli/pl-app-template/ui/tsconfig.json | {
"compilerOptions": {
"target": "es5",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"baseUrl": "src/",
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noFallthroughCas... | cc7bdea41ea9 | 23 | 547 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/cli/pl-app-template/ui/public/manifest.json | {
"short_name": "PL App",
"name": "PyTorch Lightning App",
"icons": [
{
"src": "favicon.svg",
"sizes": "512x512 192x192 64x64 32x32 24x24 16x16",
"type": "image/svg+xml"
}
],
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}
| 43593ab569d1 | 16 | 318 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/cli/pl-app-template/ui/src/lightning-colors.ts | export const LIGHTNING_PURPLE = "#6162D1";
export const BREADCRUMBS_BACKGROUND = "#F7F8FB";
| 3e77685ea4ba | 3 | 92 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/cli/pl-app-template/ui/src/react-app-env.d.ts | /// <reference types="react-scripts" />
| 57eda4c4c04a | 2 | 40 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/cli/pl-app-template/ui/src/reportWebVitals.ts | import { ReportHandler } from "web-vitals";
const reportWebVitals = (onPerfEntry?: ReportHandler) => {
if (onPerfEntry && onPerfEntry instanceof Function) {
import("web-vitals").then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
getCLS(onPerfEntry);
getFID(onPerfEntry);
getFCP(onPerfEntry)... | 780f64898ef4 | 16 | 425 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/cli/pl-app-template/ui/src/hooks/useLightningState.ts | import { useEffect, useState } from "react";
import type { LightingState } from "../types/lightning";
interface LightningState {
subscribe(handler: (state: any) => void): () => void;
next(state: any): void;
}
declare global {
interface Window {
LightningState: LightningState;
}
}
export const useLightni... | ddc4b8be1b4c | 32 | 669 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/cli/pl-app-template/ui/src/types/lightning.ts | /**
* Represents the internal state of a Lightning app as exposed by
* the `/state` endpoint of the Lightning HTTP API.
*/
export type LightingState = {
vars: {
_layout: Layout | Layout[];
[key: string]: any;
};
calls: {
[key: string]: {
name: string;
call_hash: string;
ret: boole... | ec8d864896d2 | 58 | 988 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/cli/react-ui-template/README.md | # React-ui template
This is a full react template ready to use in a component
This UI was automatically generated with:
```commandline
lightning_app init react-ui
```
### Delete files
This template has 3 main files/folders:
- README.md
- example_app.py
- ui
The README.md and example_app.py are here to help you g... | 918a91b9efb9 | 104 | 2,347 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/cli/react-ui-template/example_app.py | # example_app.py
from pathlib import Path
from lightning.app import LightningApp, LightningFlow, frontend
class YourComponent(LightningFlow):
def __init__(self):
super().__init__()
self.message_to_print = "Hello World!"
self.should_print = False
def configure_layout(self):
r... | 80b141b02eb5 | 34 | 837 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/cli/react-ui-template/ui/package.json | {
"name": "hello-world",
"private": true,
"version": "0.0.0",
"scripts": {
"start": "vite",
"build": "tsc --noEmit && vite build",
"preview": "vite preview"
},
"dependencies": {
"@emotion/react": "^11.8.2",
"@emotion/styled": "^11.8.1",
"@mui/material": "5.8.5",
"axios": "^1.6.0"... | 6a8a6029f117 | 32 | 713 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/cli/react-ui-template/ui/tsconfig.json | {
"compilerOptions": {
"target": "ESNext",
"useDefineForClassFields": true,
"lib": ["DOM", "DOM.Iterable", "ESNext"],
"allowJs": false,
"skipLibCheck": false,
"esModuleInterop": false,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
... | e40fa8bf6bdd | 22 | 560 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/cli/react-ui-template/ui/tsconfig.node.json | {
"compilerOptions": {
"composite": true,
"module": "esnext",
"moduleResolution": "node"
},
"include": ["vite.config.ts"]
}
| 810d8b9dcc2c | 9 | 142 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/cli/react-ui-template/ui/vite.config.ts | import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
// NOTE: Component UI's are served under `/{componentName}/` subpath, so the app needs to be configured for relative base path.
base: "./",
});
| 10ae2e7a2915 | 10 | 310 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/cli/react-ui-template/ui/src/vite-env.d.ts | /// <reference types="vite/client" />
| 65996936fbb0 | 2 | 38 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/cli/react-ui-template/ui/src/hooks/useLightningState.ts | import { useState, useEffect } from "react";
import type { LightingState } from "../types/lightning";
interface LightningState {
subscribe(handler: (state: any) => void): () => void;
next(state: any): void;
}
declare global {
interface Window {
LightningState: LightningState;
}
}
export const useLightni... | f4eec90c3303 | 32 | 669 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/cli/react-ui-template/ui/src/types/lightning.ts | /**
* Represents the internal state of a Lightning app as exposed by
* the `/state` endpoint of the Lightning HTTP API.
*/
export type LightingState = {
vars: {
_layout: Layout | Layout[];
[key: string]: any;
};
calls: {
[key: string]: {
name: string;
call_hash: string;
ret: boole... | ec8d864896d2 | 58 | 988 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/components/README.md | TODO: add a guide how to add and use an external component
| cd0adf7172b3 | 2 | 59 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/components/__init__.py | from lightning.app.components.database.client import DatabaseClient
from lightning.app.components.database.server import Database
from lightning.app.components.multi_node import (
FabricMultiNode,
LightningTrainerMultiNode,
MultiNode,
PyTorchSpawnMultiNode,
)
from lightning.app.components.python.popen i... | d69a9271aac5 | 42 | 1,430 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/components/training.py | # Copyright The Lightning AI team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | 9015cd1cdbc6 | 204 | 7,247 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/components/database/__init__.py | from lightning.app.components.database.client import DatabaseClient
from lightning.app.components.database.server import Database
__all__ = ["Database", "DatabaseClient"]
| 9a67b2bf258f | 5 | 172 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/components/database/client.py | # Copyright The Lightning AI team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | 01ea6c3b1921 | 94 | 3,170 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/components/database/server.py | # Copyright The Lightning AI team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | 8a00413ddddf | 244 | 8,507 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/components/database/utilities.py | # Copyright The Lightning AI team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | b05c6c423cfe | 264 | 9,247 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/components/multi_node/__init__.py | from lightning.app.components.multi_node.base import MultiNode
from lightning.app.components.multi_node.fabric import FabricMultiNode
from lightning.app.components.multi_node.pytorch_spawn import PyTorchSpawnMultiNode
from lightning.app.components.multi_node.trainer import LightningTrainerMultiNode
__all__ = ["FabricM... | 99455cb00631 | 7 | 398 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/components/multi_node/base.py | # Copyright The Lightning AI team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | 6ff5fb92df2e | 108 | 3,900 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/components/multi_node/fabric.py | # Copyright The Lightning AI team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | e3db15b86639 | 133 | 4,664 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/components/multi_node/pytorch_spawn.py | # Copyright The Lightning AI team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | 01c0d10f87e3 | 120 | 4,159 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/components/multi_node/trainer.py | # Copyright The Lightning AI team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | 19e05f5ded50 | 131 | 4,748 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/components/python/__init__.py | from lightning.app.components.python.popen import PopenPythonScript
from lightning.app.components.python.tracer import TracerPythonScript
__all__ = ["PopenPythonScript", "TracerPythonScript"]
| 214e56ad2595 | 5 | 193 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/components/python/popen.py | # Copyright The Lightning AI team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | dccb5a41b398 | 114 | 3,945 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/components/python/tracer.py | # Copyright The Lightning AI team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | 7b0fa0c4abdb | 201 | 7,398 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/components/serve/__init__.py | from lightning.app.components.serve.auto_scaler import AutoScaler
from lightning.app.components.serve.cold_start_proxy import ColdStartProxy
from lightning.app.components.serve.gradio_server import ServeGradio
from lightning.app.components.serve.python_server import Category, Image, Number, PythonServer, Text
from ligh... | 26fe77dce8f9 | 18 | 550 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/components/serve/auto_scaler.py | # Copyright The Lightning AI team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | c3406fdaf841 | 754 | 30,437 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/components/serve/cold_start_proxy.py | # Copyright The Lightning AI team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | c129415e9e26 | 73 | 2,847 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/components/serve/gradio_server.py | # Copyright The Lightning AI team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | 4bd7b82588b2 | 201 | 7,068 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/components/serve/python_server.py | # Copyright The Lightning AI team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | 2cd9c0cf6596 | 329 | 11,227 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/components/serve/serve.py | # Copyright The Lightning AI team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | 8d82926b15c9 | 171 | 5,940 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/components/serve/streamlit.py | # Copyright The Lightning AI team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | cf5e09074eae | 175 | 5,610 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/components/serve/types/__init__.py | from lightning.app.components.serve.types.image import Image
_SERIALIZER = {"image": Image.serialize}
_DESERIALIZER = {"image": Image.deserialize}
| 3851142de377 | 5 | 148 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/components/serve/types/image.py | # Copyright The Lightning AI team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | 269fc9aad59b | 46 | 1,514 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/components/serve/types/type.py | # Copyright The Lightning AI team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | cf12c415d379 | 33 | 1,096 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/core/__init__.py | from lightning.app.core.app import LightningApp
from lightning.app.core.flow import LightningFlow
from lightning.app.core.work import LightningWork
__all__ = ["LightningApp", "LightningFlow", "LightningWork"]
| 35346b96880d | 6 | 210 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/core/api.py | # Copyright The Lightning AI team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | a196089ed1e8 | 499 | 18,656 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/core/app.py | # Copyright The Lightning AI team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | ae33e43a9e3f | 747 | 30,345 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/core/constants.py | # Copyright The Lightning AI team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | 0f758fa8fefd | 160 | 6,814 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/core/flow.py | # Copyright The Lightning AI team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | fc176f8b06c4 | 867 | 33,256 |
Lightning-AI/pytorch-lightning | 2.3.2 | lightning/app/core/queues.py | # Copyright The Lightning AI team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | d950ffe4ddd1 | 586 | 22,190 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.