semvec/pypi-packages huggingface dataset:
pysilverse 0.1.2
Common Silverse Development Module
Requires Python: >=3.6

# PySilverse

### Local

```
export PYTHONPATH=/path/to/pysilverse:$PYTHONPATH
```

### Docker

0. Buid local **development** docker image

```
bash development.sh
```

1. Run **development** image with local source

```
sudo docker run \
  -it \
  --name pysilverse --rm \
  -v /home/ermiry/Documents/Work/pysilverse:/home/pysilverse \
  itsilverse/pysilverse:development /bin/bash
```

2. Handle **pysilverse** module

```
export PYTHONPATH=$pwd:$PYTHONPATH
```
talktosql 0.0.1
Query your DB using natural language instead of SQL queries
Requires Python: >=3.7

# TalkToSQL

TalkToSQL is an CLI tool that lets you query your DB with natural language instead of SQL queries.

## Usage

```sh
$ talktosql learn
Successfully saved the DB Schema Info to /Users/woniesong92/.talktosql_schema_info

$ talktosql ask --q "Who owns a dog?"
SELECT o.first_name, o.last_name FROM Owners o JOIN Pets p ON o.owner_id = p.owner_id WHERE p.species = 'dog';
+------------+-----------+
| first_name | last_name |
+------------+-----------+
|    John    |    Doe    |
|    Jane    |    Doe    |
|    Bob     |   Smith   |
+------------+-----------+

$ talktosql ask --q "Is there anyone who owns a cat named Mittens?"
SELECT o.first_name, o.last_name FROM Owners o JOIN Pets p ON o.owner_id = p.owner_id WHERE p.species = 'cat' AND p.pet_name = 'Mittens';
+------------+-----------+
| first_name | last_name |
+------------+-----------+
|   Alice    |  Johnson  |
+------------+-----------+
```

## Quickstart

1. Install the package

    ```
    pip install talktosql -U
    ```
2. Set the environment variables

    You can create a `.env` file in your local directory to get kickstarted.

    ```.env
    OPENAI_API_KEY="SOME_API_KEY"
    OPENAI_ORG_ID="SOME_ORG_ID"
    OPENAI_MODEL_NAME="gpt-4"
    TALKTOSQL_DATABASE_URL="mysql://myuser:mypassword@localhost/mydb"
    TALKTOSQL_DATABASE_NAME="mydb"
    ```

    Alternatively, you can run these in your terminal or set these in your terminal config (~/.zshrc)

    ```sh
    export OPENAI_API_KEY="SOME_API_KEY"
    export OPENAI_ORG_ID="SOME_ORG_ID"
    export OPENAI_MODEL_NAME="gpt-4"
    export TALKTOSQL_DATABASE_URL="mysql://myuser:mypassword@localhost/mydb"
    # export TALKTOSQL_DATABASE_URL="postgresql://myuser:mypassword@localhost/mydb"
    export TALKTOSQL_DATABASE_NAME="mydb"
    ```

    - Get the value for `OPENAI_API_KEY` from [OpenAI API Keys](https://platform.openai.com/account/api-keys)
    - Get the value for `OPENAI_ORG_ID` from [OpenAI Org Settings](https://platform.openai.com/account/org-settings)

3. Help TalktoSQL learn your DB Schema. This will save your DB schema info to a file in your home directory (`~/.talktosql_schema_info`)

    ```sh
    talktosql learn
    ```

4. Query your DB in English intead of an SQL query

    ```sh
    talktosql ask --q "how many dogs are there?"
    ```
django-web-utils 0.4.6
Django helpers for working with the web.


Django Web Utils

Some helpers for working with the web.

Provided are:

format_currency
---------------
formats currency (USD) to a string.

>>> cash = 1250
>>> formatted = format_currency(cash)
'$1,250.00'

>>> formatted = format_currency(cash, places=0)
'$1,250'

>>> cash = 0
>>> formatted = format_currency(cash, show_zero=False)
''


format_currency template tag
---------------------------------------------------
For django to be able to find the templatetags, you'll need to register
`web_utils` in your INSTALLED_APPS settings

{% load formatting_tags %}

# value, places, show_zero flag.
{% format_currency cash_amount 0 "False" %}


ping_google_sitemap
-------------------
A signal receiver to ping Google Sitemap to let them know your content changed

1. Add the following to settings.py
   PING_GOOGLE_SITEMAP = True
   SITE_DOMAIN = 'http://www.example.com'

2. Add a named url: 'sitemap' so the method can resolve your sitemap url

3. Register the receiver on whatever signal you'd like to trigger the ping.

   receiver(models.signals.post_save, sender=BlogEntry, dispatch_uid="BlogEntry")(ping_google_sitemap)


SSLMiddleware
-------------
Allows you to force various urls through https or http

1. Add `SSL_ENABLED = True`  to your settings.py

2. Add `web_utils.middleware.SSLMiddleware` to your middleware settings

3. Add a `USE_SSL` = True/False to a route's view_kwargs

   url(r'^admin/', include(admin.site.urls), kwargs={'USE_SSL': True}),

By default, all routes will be forced to http unless they have `USE_SSL=True`
If you would like to flip this and secure everything except only specific routes
add `USE_SSL_DEFAULT=True` to your settings.
img2array-akselmo 1.0.5
Prints the pixels of an image into an array of RGB values, that can be easily exported to embedded applications.
Requires Python: >=3.7

# img2array

Prints the pixels of an image into an array of RGB values.
This can be copied easily to other applications, such as embedded apps.

# Commands

-h, --help    :  Help text  
-i, --image   :  Image file path  
-p, --prefix  :  Prefix for the item, like "colorFunc\("  
-P, --postfix :  Postfix for the item, like "\)"  
-f, --format  :  Format of the color, defaults to RGB. Possible values: RGB, RGBA, Hex, HexAlpha  

# Example

`img2array -i file.png --prefix=coolFunction\( --postfix=\) --format=RGB`

**Note**: the \ before () may be required or not depending on the shell you're using.

This should print an array version of the image like

```
{
    {coolFunction(200,200,200), coolFunction(123,123,123)},
    {coolFunction(111,111,111), coolFunction(41,0,12)}
}
```

You can then easily copy-paste this to your applications.
dalaipy 2.0.2
A Python Wrapper for Dalai
Requires Python: >=3.7

# dalaipy
A Python Wrapper for [Dalai](https://github.com/cocktailpeanut/dalai)!

Dalai is a simple, and easy way to run LLaMa and Alpaca locally.

## Installation
`pip install dalaipy==2.0.2`

https://pypi.org/project/dalaipy/2.0.2/

## Instructions
1. Go to [Dalai](https://github.com/cocktailpeanut/dalai), and set up your model of choice on your system (either Mac, Windows, or Linux). The readme provides clear explanations!
2. Once you can run `npx dalai serve`, run the server and test out your model of choice.
3. Install dalaipy per the instructions above, and make your first request:
```
from dalaipy.src import Dalai

model = Dalai()
# your_model can be one of the following, "alpaca.7B", "alpaca.13B", "llama.7B", "llama.13B", "llama.30B", or "llama.65B", and is dictated by which model you installed
request_dict = model.generate_request("What is the capital of the United States?", your_model)
print(model.request(request_dict))
```

## Credits
[@cocktailpeanut](https://github.com/cocktailpeanut) - the owner of Dalai

[@quadrismegistus](https://github.com/quadrismegistus) - made a notebook with the original idea of using python-socketio to communicate with the web server

## Docs
### Dalai Class
- generate_request() - `model.generate_request(prompt, model)`
    - `prompt`: **(required)** the prompt string
    - `model`: **(required)** the model that should be used, in the form of a string
        - `alpaca.7B`
        - `alpaca.13B`
        - `llama.7B`
        - `llama.13B`
        - `llama.30B`
        - `llama.65B`
    - `id`: the request ID (defaut is '0')
    - `n_predict`: the number of tokens to return (default is 128)
    - `repeat_last_n`: default is 64
    - `repeat_penalty`: default is 1.3
    - `seed`: the seed (default is -1)
    - `temp`: the temperature of the request (default is 0.5)
    - `threads`: the number of threads to use (default is 4)
    - `top_k`: default is 40
    - `top_p`: default is 0.9

- request() - `model.request(prompt)`
    - `prompt`: **(required)** the prompt string
    - `prettify`: whether or not to clean and output just the string, or the whole request dictionary (default is `True`)