This project has been archived by its maintainers, and is no longer receiving any updates.
lightonmuse
Python bindings for the Muse API: production-ready intelligence primitives powered by state-of-the-art language models. By LightOn.
Create. Process. Understand. Learn.
Uplift your product with the natural language generation & understanding capabilities of Muse. State-of-the-art large language models in French, English, Italian, and Spanish—with more to come—are just an API call away. Our models can help you build conversational AI, copywriting tools, text classifiers, semantic search, and more.
🛣️ Accessing the Muse API public beta
The Muse API is currently in public beta. Learn more about Muse and sign up at muse.lighton.ai.
Installation and documentation
You can install this package from PyPi with:
pip install lightonmuse
To install from source:
git clone https://github.com/lightonai/lightonmuse.git
cd lightonmuse
pip install ./
Once the package is installed, make sure to define an environment variable
MUSE_API_KEY to your API key, e.g. by adding the following line to your .bashrc
export MUSE_API_KEY="<your api key>"
Guides and documentation can be found at the API docs website.
Quickstart
Using lightonmuse is pretty simple, the interface matches the endpoints offered by the Muse API
Create
from lightonmuse import Create
creator = Create("lyra-en")
print(creator("Wow, the Muse API is really amazing"))
Select
from lightonmuse import Select
selector = Select("orion-fr-v2")
print(selector("Quel nom est correct?", candidates=["pain au chocolat", "chocolatine"]))
CalibratedSelect
from lightonmuse import CalibratedSelect
selector = CalibratedSelect("orion-fr-v2")
selector.fit(
content_free_inputs='Voici une critique : "" \n',
candidates=["positive", "négative"],
conjunction="Cette critique est"
)
critique = 'Voici une critique : "Ce film est super pour s\'endormir"'
print(selector(critique, candidates=["positive", "négative"], conjunction="Cette critique est"))
Analyse
from lightonmuse import Analyse
analyser = Analyse("orion-fr-v2")
print(analyser("Avec \"Analyse\" on peut toujours trouver les parties plus surprenantes d'une phrase."))
Embed
from lightonmuse import Embed
embedder = Embed("lyra-en")
print(embedder("This sentence will be transformed in a nice matrix of numbers."))
Compare
from lightonmuse import Compare
comparer = Compare("lyra-en")
print(comparer("This is the reference.", candidates=["This is close to the reference", "While this is most definitely not"]))
Tokenize
from lightonmuse import Tokenize
tokenizer = Tokenize("lyra-en")
print(tokenizer("Let's discover how many tokens is this text"))
Access to LightOn MUSE
Access the public beta of LightOn MUSE and try our intelligence primitives at muse.lighton.ai
Metadata
Release files for lightonmuse 0.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| lightonmuse-0.5.0-py3-none-any.whl | Python 3 | none | any | Details for lightonmuse-0.5.0-py3-none-any.whl |
Release files / lightonmuse-0.5.0-py3-none-any.whl
| Download URL | lightonmuse-0.5.0-py3-none-any.whl |
|---|---|
| Size | 10.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
35d917de39f421d99caeac42552c7d0c313edc48e75c9f29b199e1abe79b9cb3
|
|
BLAKE2b-256 checksum How to use checksums |
c350caee1d2e4e03f761d4d44909f0d0990d30625ee494fc96037d930c1f4299
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/3.7.3 pkginfo/1.8.2 requests/2.28.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.6
|
Security for lightonmuse 0.5.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.