semvec/pypi-packages huggingface dataset:
ng-bot 1.0.3
Bot Integrations with various platforms to send latest ngork links
License: MIT
Requires Python: >=3.8,<4.0

# Ng-Bot

Ngrok Bot (Ng-Bot) publishes updated ngrok URLs to telegram chat ids and restricts other users to access the bot or on discord using webhook url.

> `Note`: This bot may be used for malicious purposes too. Its upto users how they use this tool/bot. Author is not responsible for user's action in any manner.

## Installation

- Clone repo

  ```bash
  git clone --depth=1 https://github.com/dmdhrumilmistry/ng_bot.git
  ```

- Change directory

  ```bash
  cd ng_bot
  ```

- Install requirements

  ```bash
  python3 -m pip install -r requirements.txt
  ```

## Usage

- Create Ngrok account

- Complete Sign Up process

- Add new AUTH TOKEN from [dashboard](https://dashboard.ngrok.com/get-started/your-authtoken)

- Store variables in `.env` file

  ```bash
  NGROK_AUTH_TOKEN='your_auth_token'
  TELE_BOT_TOKEN='telegram_bot_token'
  ALLOWED_USER_IDS=tele_user_id1, tele_user_id2, tele_user_id3
  DISCORD_WEBHOOK_URL='webhook-url' 
  ```

  > Above variables can also be stored in environment variables

- Start application

  ```bash
  # for telegram
  python3 -m ng_bot --http 8080 --tcp 22 4444 --platform telegram

  # for discord
  python3 -m ng_bot --tcp 22 --platform discord
  ```
pytorch-basic-frame 0.0.4
A frame for training in pytorch
License: MIT
Requires Python: >=3.8

# pytorch basic frame

## Table of Contents

- [About](#about)
- [Getting Started](#getting_started)
- [Usage](#usage)
- [Contributing](../CONTRIBUTING.md)

## About <a name = "about"></a>

By providing datasets, configuration files, and some scripts, you can use this framework to get results without refactoring the code.

## Getting Started <a name = "getting_started"></a>

### Prerequisites
develop environment:
```
# pip install
Pillow==9.4.0
PyYAML==6.0
setuptools==65.6.3
tensorboardX==2.6
torch==1.13.1+cu117
torchmetrics==0.11.1
torchvision==0.14.1+cu117
tqdm==4.64.1
```

### Installing
```
pip install pytorch-basic-frame
```


## Usage <a name = "usage"></a>

### arguments
for datasets:
+ root: root path of dataset relative to cwd, eg. 'datasets/'.
+ classes: a list of class names, eg. [cat,dog,fish]. Put this attribute in your dataset is recommand.
+ split_rate: rate for split datasets, eg. [0.7,0.3]

for train:
+ gpus: gpus that used, default is [] (means cpu), [0] or [0,1] is ok.
+ epochs
+ batch_size
+ lr

for save results:
+ save_name: str for save model name
+ save_suffix: eg. tar, pth

for config in yaml/yml file:
+ config: path of config file, eg. config.yml.

Defining other arguments in your config file is permitted.

priority:
cmd line > config.yml > default

### demo
```python
# main.py
import torch
from torchvision.datasets import MNIST
from torchvision.models import resnet34
from torchvision import transforms
import torchmetrics
from torchframe import Frame

project = Frame()
# prepare data
transform = transforms.ToTensor()
target_transform = lambda x: torch.tensor(x, dtype=torch.long)
project.dataset = MNIST(
    root="datasets",
    train=True,
    download=True,
    transform=transform,
    target_transform=target_transform,
)
# prepare model
project.model = resnet34()
project.model.fc = torch.nn.Linear(
    project.model.fc.in_features, len(project.dataset.classes)
)
project.model = torch.nn.Sequential(torch.nn.Conv2d(1, 3, 3, 1), project.model)
# prepare train
project.loss_fun=torch.nn.CrossEntropyLoss()
project.optimizer=torch.optim.Adam(project.model.parameters(),project.LR)
# prepare metrics
project.output_formater=lambda x: torch.max(x,dim=1).indices
project.train_metrics={
    'acc':torchmetrics.Accuracy(task="multiclass",num_classes=len(project.CLASSES)),
    'prec':torchmetrics.Precision(task="multiclass", average='micro', num_classes=len(project.CLASSES))
}
project.valid_metrics=project.train_metrics
# prepare save
project.best_ckpt_selectors=['acc','prec']
project.train()
```