semvec/pypi-packages huggingface dataset:
gemini-library 1.0.0
Gemini API response handler with Markdown to HTML conversion
Requires Python: >=3.7

# Gemini Library

`gemini-library` is a lightweight Python package that integrates with Google's Gemini API to generate rich, formatted responses from prompts. It supports Markdown-to-HTML conversion and basic HTML tag filtering to produce clean, safe output for web applications.

---

## ✨ Features

- Easy Gemini API integration
- Markdown to safe HTML conversion
- Custom HTML tag filtering
- Modular class-based design
- Python 3.7+ compatible

---

## 📦 Installation

### From PyPI (after upload)
```bash
pip install gemini-library
YggSimLib 0.97
A library for interfacing with the kspice API for the Yggdrasil project
Requires Python: >=3.12

# YggSimLib

YggSimLib is a Python framework for orchestrating and automating simulation workflows in the Yggdrasil Engineering Simulator. It allows for modular control of simulated equipment such as valves, motors, heaters, PID controllers, and choke valves, and supports stepwise and parallel sequence execution with inhibit logic and transition conditions.

## Features

- Object-oriented wrappers for:
  - On/off valves
  - Electric motors and heaters
  - PID controllers
  - Choke valves
  - Transmitters
- Flexible step-based sequencer (`Step`, `Sequence`)
- Inhibit logic for conditional execution
- Dependency-managed sequence orchestration via `Admin`
- GUI support for selecting models, timelines, and data files
- Parallel execution support using threads

## File Structure

- `YggSimLib.py`: Core library with class definitions and sequence execution engine
- `muninUtilities.py`: Example configuration for a multi-system simulation setup
- `main.py`: Startup script to initialize and run the sequences

## Quick Start

```bash
python main.py
```

### GUI Prompts
You’ll be prompted to select:
1. Simulation model directory
2. Timeline
3. Model, parameter, and initial condition files

Once loaded, the simulation sequences will begin executing according to defined dependencies.

## Example: Defining a Step

```python
step = Step({
    "number": 10,
    "actions": [valve.open],
    "transitions": [valve.is_open],
    "tmax": 30,
    "next": lambda: "S020"
})
```

## Sequence Logic

```python
steps = {"S010": step1, "S020": step2}
sequence = Sequence("pump_start", steps, sim)
sequence.add_steps(steps.values())
sequence.start()
```

## Admin Graph
Use `Admin` to define a full system of sequences with dependencies:

```python
a = Admin("startup_controller", [seq1, seq2, seq3], edges, sim)
a.start()
```

## Documentation Style
Docstrings follow the Google Python style guide and describe:
- Arguments
- Behavior
- Return values (where applicable)

## Requirements
- Python 3.12
- Yggdrasil Engineering Simulator (with `kspice` Python bindings)
- `networkx` for dependency graphs

## Author
Built by Håkon – Process Data Scientist, passionate about simulation, optimization.
mambax 0.4.1
Optimized Mamba implementation with chunk processing and ONNX export
Requires Python: >=3.10
Keywords: mamba, pytorch, deep learning

# MambaX

PyTorch implementation of the Mamba architecture with enhanced production-ready features:

1. **ONNX Export** - Full model export support for deployment
2. **Chunk Processing** - Single-forwardpass chunk handling (no token loops)
3. **CPU-First** - Optimized execution without CUDA dependencies

## Installation

Install the package directly from PyPI:

```bash
pip install mambax
```

## Key Advantages

- **Production Ready**: ONNX-compatible for serving
- **No Token Loops**: Processes entire chunks in single forward pass
- **Hardware Agnostic**: Runs equally well on CPU/GPU

## Acknowledgements
Builds upon reference work from [alxndrTL/mamba.py](https://github.com/alxndrTL/mamba.py)

## Usage

### 1. Standard Forward Pass
```python
import torch
import torch.nn as nn
from mambax import Mamba

# Initialize model
model = Mamba(
    d_model=512,
    d_inner=1024,
    d_conv=4,
    d_state=16,
    dt_rank=64,
    use_cuda=False
)

# Process full sequence
x = torch.rand(1, 128, 512)  # (batch, seq_len, dim)
output = model(x)  # single forward pass
```

### 2. Single Token Processing
```python

x_token = torch.rand(1, 1, 512)  # (batch, 1, dim)
output, new_state, new_conv = model(x_token, state_cache, conv_cache)

```

### 3. Chunk-Based Processing
```python

# Initialize with empty caches
state_cache = torch.zeros(1, 1024, 16)  # (batch, d_inner, d_state)
conv_cache = torch.zeros(1, 1024, 3)     # (batch, d_inner, d_conv-1)

# Process chunks (e.g. 8 tokens at once)
x_chunk = torch.rand(1, 8, 512)
output, new_state, new_conv = model(x_chunk, state_cache, conv_cache)
```