semvec/pypi-packages huggingface dataset:
codara-model-trainer 2.0.0
OpenAI Model Trainer and Formatter

# codara-model-trainer

## Overview

The `codara-model-trainer` is a Python package designed to assist in creating datasets for fine-tuning machine learning
models, particularly language models. It simplifies the process of gathering and formatting training data in a JSON
Lines (JSONL) format.

## Features

- Easy creation of training data sets in JSONL format.
- Methods to set system instructions, training prompts, and generative responses.
- Automatically handles file creation and appending data in the correct format.

## Installation

```python 
pip install codara-model-trainer
```

## Usage

1. Create the data set with agent instructions, training prompts, and generative responses as needed:
   ```python
   from codara_model_trainer import create_data_set

   gpt_response = openai_api_call("User prompt here")
   create_data_set("System instructions here", "User prompt here", gpt_response, "optional-filepath/filename.jsonl")
   ```

The data will be saved in the `model-training/fine-tune-data-set.jsonl` file if the filepath isn't set.

## Structure of Data

The data is structured in JSON Lines format, where each line is a valid JSON object. An example of the data structure:

```json
{
  "messages": [
    {
      "role": "system",
      "content": "System instructions here"
    },
    {
      "role": "user",
      "content": "User prompt here"
    },
    {
      "role": "assistant",
      "content": "Model response here"
    }
  ]
}
```
zdgram 0.1.dev7
Python module based on https://core.telegram.org/bots/api
Requires Python: ~=3.8
Keywords: bots,bot-api,telegram


# Install :
```commandline
pip install -U zdgram
```

# How to use?
- Config your bot :
---
```python
from zdgram import Bot, types

API_TOKEN = "API_TOKEN_HERE"

bot = Bot(API_TOKEN, allowed_updates=["message"])
```

- Add handlers to recive updates from telegram:
---
- Any update from telegram:
```python
@bot.onUpdate
async def on_updates(bot: Bot, update: types.Update):
    print(update)
```

- message and edited_message:
```python
@bot.onMessage()
async def on_message(bot: Bot, message: types.Message):
    print(message)

@bot.onEditedMessage()
async def on_edited_message(bot: Bot, message: types.Message):
    print(message)

# Custom filter
def filter_admin(message: types.Message):
    admins = [123456789, 987654321]
    return bool(message.from_user.id in admins)

@bot.onMessage(func=filter_admin)
@bot.onEditedMessage(func=filter_admin)
async def on_custom_filter(bot: Bot, message: types.Message):
    print(message)

# Echo Bot
@bot.onMessage(func=lambda m: m.text)
async def echo(bot: Bot, message: types.Message):
    return await bot.sendMessage(
        message.chat.id,
        message.text,
        entities=message.entities
    )
```

- Callback Queries .
```python
@bot.onCallbackQuery()
async def on_callback_query(bot: Bot, callback_query: types.CallbackQuery):
    return await bot.sendMessage(
        callback_query.message.chat.id,
        callback_query.data
    )
```

- Inline Queries .
```python
@bot.onInlineQuery()
async def on_inline_query(bot: Bot, inline_query: types.InlineQuery):
    print(inline_query)
```

- Start the bot:
---
```python
import logging

logging.basicConfig(level=logging.INFO)

bot.run()
```

- Start multiple bots:
---
```python
import logging

from zdgram import run_multiple_bots, Bot, types, enums

logging.basicConfig(level=logging.INFO)

bot_1 = Bot("API_TOKEN_1")
bot_2 = Bot("API_TOKEN_2")

@bot_1.onMessage()
@bot_2.onMessage()
async  def on_message(bot: Bot, message: types.Message):
    return await bot.sendMessage(
        message.chat.id,
        (await bot.getMe()).mention.markdown,
        parse_mode=enums.ParseMode.MARKDOWN
    )

bot_1.run(run_multiple_bots([bot_1, bot_2]))
```

- Create Listener ( Conversation ):
---
```python
from zdgram import types, enums, Bot

bot = Bot(bot_token="")

def filter_text_and_private(m: types.Message):
    return bool(m.text and m.chat.type == enums.ChatType.PRIVATE)

@bot.onMessage(func=filter_text_and_private)
async def on_message(bot: Bot, message: types.Message):
    await bot.sendMessage(
        message.chat.id,
        "Send your name",
        reply_to_message_id=message.id
    )
    msg = await bot.listen(filter_text_and_private)
    return await bot.sendMessage(
        message.chat.id,
        "Your name is : " + msg.text
    )
```

# LICENSE :
- [MIT](https://github.com/x72x/zdgram/blob/master/LICENSE)
first-package-by-shibilicv 1.0.0
A simple Python package that allows to add, subtract, multiply, and divide by three
Requires Python: >=3.6

MIT License

Copyright (c) 2024 Muhammed Shibili cv

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.