semvec/pypi-packages huggingface dataset:
functional-maybe 1.1.8
Wrapper class. Basically functional Maybe or Railway pattern.
Requires Python: >=3.6

# FunctionalMaybe
A simple Maybe wrapper class that works. Creates a wrapper around variable and allows transformation of said variable to different values and supplying it to functions.

# Usage:

```Python
import sys
from FunctionalMaybe import FunctionalMaybe as Maybe

joined = Maybe(["one", "two", "three"])\
        .transform(lambda list_: ", ".join(list_))\  # Transform the values to something with lambda
        .run(lambda result: print(result))\          # Run functions with the contained value
        .unwrap()                                    # Return the wrapped value

# We can easily e.g. print, if the wrapped value was an empty
if isinstance(joined, Maybe.Empty):
    print(str(joined), file=sys.stderr)

```

Also supports calling the constructure inside the Maybe-class, which enables error handling via Maybe.Empty:
```Python
from FunctionalMaybe import FunctionalMaybe as Maybe

class Foo:
    def __init__(self, x, y, z=None, w=1):
        self.x = x
        self.y = y
        self.z = z
        self.w = w

    def __str__(self):
        return f"{self.x}, {self.y}, {self.z}, {self.w}"

def log(val):
    print(val)

Maybe().construct(Foo, 1, "one", w=4).transform(lambda foo: str(foo)).run(log)
# or could utilize the Maybe.Unwrapper in the following way:
Maybe("one").construct(Foo, 1, Maybe.Unwrapper, w=4).transform(lambda foo: str(foo)).run(log)
# When ever Maybe.Unwrapper is supplied as an argument, the Maybe.Unwrapper object
# is mapped to the wrapped value contained by the Maybe
```
smart-context 0.0.10
Large Language Models Tools
Requires Python: >=3.10

## Environment
To create a Python virtual environment, use the command:
```console
conda env create -f environment.yml
```

## Installation
```console
pip install smart-context
```

## Supported Models
The following LLM models are supported:
- CohereForAI/c4ai-command-r-08-2024
- google/gemma-2-27b-it
- mistralai/Mistral-Large-Instruct-2407
- Qwen/Qwen2.5-32B-Instruct

## LLM backends
The following LLM backends are supported:
- Llama.cpp Server API

## Run Llama.CPP Server backend
```console
llama.cpp/build/bin/llama-server -m model_q5_k_m.gguf -ngl 99 -fa -c 4096 --host 0.0.0.0 --port 8000
```

## Install CUDA toolkit for Llama.cpp compilation
Please note that the toolkit version must match the driver version. The driver version can be found using the nvidia-smi command.
To install toolkit for CUDA 12.5 you need to run the following commands:
```console
CUDA_TOOLKIT_VERSION=12-5
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.1-1_all.deb
sudo dpkg -i cuda-keyring_1.1-1_all.deb
sudo apt update
sudo apt -y install cuda-toolkit-${CUDA_TOOLKIT_VERSION}
echo -e '
export CUDA_HOME=/usr/local/cuda
export PATH=${CUDA_HOME}/bin:${PATH}
export LD_LIBRARY_PATH=${CUDA_HOME}/lib64:$LD_LIBRARY_PATH
' >> ~/.bashrc
```

## Set GPU Max Temp
```console
nvidia-smi -pm 1
sudo nvidia-smi -gtt 80
nvidia-smi -q | grep Target
```