semvec/pypi-packages huggingface dataset:
checkpointlib 0.0.2
A package to send ML training checkpoints online in Python
Requires Python: >=3.8

# checkpointlib
A package to send ML training checkpoints online in Python

When training Machine Learning models, it's common that it can take a while to train on a computer which you obviously can't sit beside all day, every day.
This library allows you to send progress checkpoints online to our servers, so that you can see your progress when you're away.

## Using checkpointlib
Once you've installed the python file containing the client-side code, you'll be able to do the following to set your program up to send progress checkpoints online.
* First, import checkpointlib:
  ```
  from checkpointlib import checkpointlib
  ```
* Create a new checkpointAccount object:
  ```
  myCheckpointAccout = checkpointlib.checkpointAccount(0)
  ```
  **OR**
  ```
  myCheckpointAccount = checkpointlib.checkpointAccount("[PUT YOUR KEY HERE]")
  ```
  If you do the first option, and make the value be the integer 0, then it will automatically create a random user key for you. However, if you choose to do the second option, then you can select your own user key.
* Save your user key for later - you can check just what your key is with ```myCheckpointAccount.key```, which you can use if you want to save to the same key later. However, you can also use ```myCheckpointAccount.url``` to get the full URL of your checkpoint account. Visit that URL to see the progress online from another device (this will be explained more later)
* Save progress to your key online - to save progress, type:
  ```
  myCheckpointAccount.saveCheckpoint("[TYPE THE PROGRESS UPDATE HERE]")
  ```
  This will save the latest progress update, which you enter as an argument, to your online key (which you can see at the URL which you receive with ```myCheckpointAccount.url```)
* Clear your checkpoint progress:
  ```
  myCheckpointAccount.clear()
  ```
  This will clear the checkpoint progress online on your key, but *does not* delete the checkpoint account.
* Delete the checkpoint account from our servers:
  ```
  myCheckpointAccount.delete()
  ```
  This will delete your account from our servers - however, it can still be created again.

## Checking progress online
To see your program's progress online, you can do one of the following:
* Go to the URL given by entering ```myCheckpointAccount.url```; OR
* Visit the webpage "https://kendasi.com/checkpoints/" + your user key (given by entering ```myCheckpointAccount.key```)

## Open source
This project is open source under the GNU 3.0 license.
You are free to use this code and anything else within the project however you see fit, besides selling it as closed-source software.
The code is avaliable on github.
bingbong 0.4.3
Ping pong is a management library for LLM applied applications.
Requires Python: >=3.8
Keywords: LLM,pingpong,prompt,context,management

# PingPong

<p align="center">
    <img width="200" src="https://raw.githubusercontent.com/deep-diver/PingPong/main/assets/logo.png">
</p>

PingPong is a simple library to manage pings(prompt) and pongs(response). The main purpose of this library is to manage histories and contexts in LLM applied applications such as ChatGPT.

The basic motivations behind this project are:
- **Abstract prompt and response so that any UIs and Prompt formats can be adopted**
  - There are a number of instruction-following finetuned language models, but they are fine-tuned with differently crafted datasets. For instance, the Alpaca dataset works when `### Instruction:`, `### Response:`, and `### Input:` are given while StackLLaMA works when `Question:` and `Answer:` are given even though the underlying pre-trained LLM is the same LLaMA.
  - There are a number of UIs built to interact with language model such as Chatbot. Even with a single example of Chatbot, one could use Gradio while other could use JavaScript based tools, and they represents prompt histories in different data structure. 
- **Abstract context management strategies to apply any number of context managements**
  - There could be a number of strategies to effectively handle context due to the limit of the number of input tokens in language model(usually 4096). It is also possible to mix different strategies.

## Installation

```shell
$ pip install bingbong
```

## Example usage

```python
from pingpong import PingPong
from pingpong.gradio import GradioAlpacaChatPPManager
from pingpong.context import CtxAutoSummaryStrategy
from pingpong.context import CtxLastWindowStrategy
from pingpong.context import CtxSearchWindowStrategy

ppmanager = GradioAlpacaChatPPManager()
strategies = [
    CtxAutoSummaryStrategy(2),
    CtxLastWindowStrategy(1),
    CtxSearchWindowStrategy(1)
]

for i in range(3):
    ppmanager.add_pingpong(PingPong(f"ping-{i}", f"pong-{i}"))

    for strategy in strategies:
        if isinstance(strategy, CtxAutoSummaryStrategy):
            sum_req, to_sum_prompt = strategy(ppmanager)

            if sum_req is True:
                # enough prompts are accumulated
                ...
        elif isinstance(strategy, CtxLastWindowStrategy):
            last_convs = strategy(ppmanager)

            # I am only interested in the last 1 conversations
            ...
        elif isinstance(strategy, CtxSearchWindowStrategy):
            for cur_win in strategy(ppmanager):
                # looking the entire conversation through
                # a sliding window, size of 1
                # find out relevant history to the recent conversation
                ...
```

## Todos

- [ ] Add a working example with Gradio application
- [ ] Make the documentation more Beginner friendly