semvec/pypi-packages huggingface dataset:
NewFunctionsPYC 1.4.0b3
:A simple library for add new functions the Pycord
License: MIT
Requires Python: >=3.8
Keywords: Pycord BetterFunctions

# NewFunctionsPYC

:A simple library for add new functions the Pycord

## Usage:
### install with pip

```shell
pip install NewFunctionsPYC
pip install -U git+https://github.com/Marciel404/NewFunctionsPYC (Instable)
```

### Import on your code:

```python
import NewFunctionsPYC
```
### Run it
```python

#More exemples in https://github.com/Marciel404/NewFunctionsPYC/tree/main/exemples

Using EmbedBuilder:

    >>> from NewFunctionsPYC import EmbedBuilder
    >>> from hexacolors import stringColor # "pip install hexacolors" for use this
    >>>
    >>> e: EmbedBuilder = EmbedBuilder()
    >>>
    >>> e.set_title("Title")
    >>>
    >>> e.set_description("Description")
    >>>
    >>> e.set_color(stringColor("indigo"))
    >>>
    >>> channel.send(embed = e.build())
    
Using client:

    >>> import NewFunctionsPYC
    >>>
    >>> client = NewFunctionsPYC.client("tokenBot")
    >>>
    >>> client.load_cogs("commands")
    >>>
    >>> client.__run__()
        
```
selfextend 0.0.1
SelfExtendAttn - Pytorch
License: MIT
Requires Python: >=3.6,<4.0
Keywords: artificial intelligence,deep learning,optimizers,Prompt Engineering

[![Multi-Modality](agorabanner.png)](https://discord.gg/qUtxnK2NMf)

# SelfExtendAttn
Implementation of SelfExtendAttn from the paper "LLM Maybe LongLM: Self-Extend LLM Context Window Without Tuning" from Pytorch and Zeta. This implementation is based mostly on the pseudocode listed in Algorithm 1 in page 4


# Install
`pip install selfextend`


## Usage
```python
import torch
from se_attn import SelfExtendAttn

# Example usage
dim = 512  # Dimension of model
g_size = 2  # Group size
w_size = 4  # Window size for neighbor tokens
self_extend = SelfExtendAttn(dim, g_size, w_size, qk_norm=True)

# Example tensors for q, k, v, and pos
q = torch.randn(1, 10, dim)
k = torch.randn(1, 10, dim)
v = torch.randn(1, 10, dim)
pos = torch.arange(0, 10).unsqueeze(0)  # Example positional indices

output = self_extend(q, k, v, pos)
print(output)
```

---

## Technical Architecture

### Key Concepts

- **Grouped Attention**: This mechanism divides the input sequence into groups and applies the attention operation within each group. It uses a floor operation to adjust the positions within the groups, enabling efficient handling of longer sequences.
  
- **Normal Attention**: Standard self-attention used in transformers, focusing on nearby tokens within a specified window.

### Attention Mechanism

The `SelfExtendAttn` module integrates these two attention strategies:

1. **Normal Attention** is applied to tokens within a neighborhood window, maintaining precise positional information for closely related tokens.
   
2. **Grouped Attention** is used for tokens outside this neighborhood window. It reduces the granularity of positional information for distant tokens, which is less critical but still contributes to the overall context understanding.

### Merge Strategy

The attention values outside the neighborhood window are replaced by those obtained from the grouped attention. This merging strategy ensures a smooth transition and efficient processing of longer sequences while preserving the essential context captured by the normal attention within the neighborhood window.

### Positional Encoding

Sine and cosine functions generate positional encodings, ensuring that the model retains an understanding of token order and position.

## Implementation Details

- **Module Class**: `SelfExtendAttn` is implemented as a subclass of `nn.Module` in PyTorch.
- **Configurability**: Key parameters such as group size and neighbor window size are configurable.
- **Causal Masking**: Ensures that the attention mechanism respects the autoregressive property of language models.



# Citation
```bibtext
@misc{jin2024llm,
    title={LLM Maybe LongLM: Self-Extend LLM Context Window Without Tuning}, 
    author={Hongye Jin and Xiaotian Han and Jingfeng Yang and Zhimeng Jiang and Zirui Liu and Chia-Yuan Chang and Huiyuan Chen and Xia Hu},
    year={2024},
    eprint={2401.01325},
    archivePrefix={arXiv},
    primaryClass={cs.CL}
}
```

# License
MIT
referencing-http 0.1.1
Serve your JSON registries over HTTP, for humans and machines alike
License: MIT
Requires Python: >=3.10
Keywords: api,asyncapi,json,jsonschema,openapi,referencing

====================
``referencing-http``
====================

|PyPI| |Pythons| |CI| |ReadTheDocs|

.. |PyPI| image:: https://img.shields.io/pypi/v/referencing-http.svg
  :alt: PyPI version
  :target: https://pypi.org/project/referencing-http/

.. |Pythons| image:: https://img.shields.io/pypi/pyversions/referencing-http.svg
  :alt: Supported Python versions
  :target: https://pypi.org/project/referencing-http/

.. |CI| image:: https://github.com/python-jsonschema/referencing-http/workflows/CI/badge.svg
  :alt: Build status
  :target: https://github.com/python-jsonschema/referencing-http/actions?query=workflow%3ACI


.. |ReadTheDocs| image:: https://readthedocs.org/projects/referencing-http/badge/?version=stable&style=flat
  :alt: ReadTheDocs status
  :target: https://referencing-http.readthedocs.io/en/stable/