Skip to main content

An AI-driven library for generating content using HuggingFace and LMStudio models.

Project description

Run

make sure to have the following 3 files :

  • hf_models.json
[
    {
        "id" : 1,
        "name" : "Mistral v0.2 ( HuggingFace )",
        "type" : "HUGGINGFACE",
        "kwargs" : {
            "api_url": "https://api-inference.huggingface.co/models",
            "headers": {
                "Authorization": "Bearer YOUR_API_KEY",
                "Content-Type": "application/json"
            },
            "model_huggingface_id": "mistralai/Mistral-7B-Instruct-v0.2",
            "default_parameters": {
                "max_length": -1,
                "max_new_tokens": 250,
                "temperature": 1e-8,
                "use_cache": true,
                "wait_for_model": true
            }
        },
        "preset" : 1
    },
    {
        "id" : 2,
        "name" : "Mistral v0.3 ( HuggingFace )",
        "type" : "HUGGINGFACE",
        "kwargs" : {
            "api_url": "https://api-inference.huggingface.co/models",
            "headers": {
                "Authorization": "Bearer YOUR_API_KEY",
                "Content-Type": "application/json"
            },
            "model_huggingface_id": "mistralai/Mistral-7B-Instruct-v0.3",
            "default_parameters": {
                "max_length": -1,
                "max_new_tokens": 250,
                "temperature": 1e-8,
                "use_cache": true,
                "wait_for_model": true
            }
        },
        "preset" : 1
    },
    {
        "id" : 3,
        "name" : "Phi 3 mini ( HuggingFace )",
        "type" : "HUGGINGFACE",
        "kwargs" : {
            "api_url": "https://api-inference.huggingface.co/models",
            "headers": {
                "Authorization": "Bearer YOUR_API_KEY",
                "Content-Type": "application/json"
            },
            "model_huggingface_id": "microsoft/Phi-3-mini-4k-instruct",
            "default_parameters": {
                "max_length": -1,
                "max_new_tokens": 250,
                "temperature": 1e-8,
                "use_cache": true,
                "wait_for_model": true
            }
        },
        "preset" : 2
    }
]
  • presets.json
[
    {
        "id" : 1,
        "name" : "Mistral Instruct",
        "input_prefix" : "[INST]",
        "input_suffix" : "[/INST]",
        "antiprompt" : "[INST]",
        "pre_prompt" : "",
        "pre_prompt_prefix" : "",
        "pre_prompt_suffix" : ""
    },
    {
        "id" : 2,
        "name" : "Phi 3",
        "input_prefix" : "<|user|>\n",
        "input_suffix" : "<|end|>\n<|assistant|>\n",
        "antiprompt" : "\"<|end|>\",  \"<|assistant|>\"",
        "pre_prompt" : "",
        "pre_prompt_prefix" : "<|end|>\n",
        "pre_prompt_suffix" : "<|system|>\n"
    }
]
  • tokens.json : More tokens mean more reliability and fault tolerence, in my case I used 10 HuggingFace tokens.
[
    {
        "id": 1,
        "name": "First",
        "value": "A HuggingFace api token"
    },
    {
        "id": 2,
        "name": "Second",
        "value": "Another token just to make sure the requests don't fail"
    },
    {
        "id": 3,
        "name": "Third",
        "value": "a third token as a backup"
    }
    ... Add more as needed
]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

echolib-0.1.2.tar.gz (12.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

echolib-0.1.2-py3-none-any.whl (15.7 kB view details)

Uploaded Python 3

File details

Details for the file echolib-0.1.2.tar.gz.

File metadata

  • Download URL: echolib-0.1.2.tar.gz
  • Upload date:
  • Size: 12.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.9.20

File hashes

Hashes for echolib-0.1.2.tar.gz
Algorithm Hash digest
SHA256 5bb6ab8e9e8a07edbe7d0a9236904f8d179652c485764e3b4a9cb6ba0cd781c3
MD5 df44f47d21f1051c35cb32ecf0a9268c
BLAKE2b-256 9bd5b68373e31b9f70564185aeb6de71c52d9951b77068885775017fa0c06b7a

See more details on using hashes here.

File details

Details for the file echolib-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: echolib-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 15.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.9.20

File hashes

Hashes for echolib-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a37000b15b4501eb37bacb6bfe03d734d75c6be4f6685209b27a4470197a6627
MD5 08bae49a1e581efb81dc12f67da5c8a4
BLAKE2b-256 e92fd6800d316151b22a034923d0472442f587edfe67a31aeaad32500194457e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page