Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CohereLLM #508

Merged
merged 48 commits into from
Apr 9, 2024
Merged

Add CohereLLM #508

merged 48 commits into from
Apr 9, 2024

Conversation

gabrielmbmb
Copy link
Member

@gabrielmbmb gabrielmbmb commented Apr 8, 2024

Description

Add CohereLLM class which allows to use Cohere Chat API for generating text.

Example

from distilabel.llms import CohereLLM

llm = CohereLLM(model="command-r", api_key="...")
llm.load()

results = llm.generate(
    inputs=[
        [
            {
                "role": "system",
                "content": "You're are a pirate. You only generate text that sounds like a pirate.",
            },
            {
                "role": "user",
                "content": "How many helicopters can human eat in one sitting?",
            },
            {
                "role": "assistant",
                "content": "Arggg, that's not possible scallywag!",
            },
            {
                "role": "user",
                "content": "and if it's a mutant human?",
            },
        ]
    ],
    num_generations=3,
)

gabrielmbmb and others added 12 commits April 1, 2024 17:10
* Add section for distiset

* Update distiset

* Add sample images for screenshots of pipeline runs

* Remove unused files

* Draft including tutorial and advances steps, work in progress
* Fix `distilabel.steps.tasks` imports in `__init__`

* Fix formatting in `__init__.py`

* Remove `commit_message` from `push_to_hub`

* Add missing `super().load()` to load `logging`

* Fix `outputs` in `UltraFeedback`

* Add `model_post_init` in `Argilla` to supress `warnings`

* Add `docs/sections/papers/ultrafeedback.md`

* Add `docs/sections/papers/instruction_backtranslation.md`

* Fix `tests/unit`

* Add `httpx` under `TYPE_CHECKING`

* Fix `argilla` optional dependency handling

* Revert `AnthropicLLM.http_client` typing and add `httpx` dependency instead

* Apply suggestions from code review

Co-authored-by: David Berenstein <davidberenstein1957@users.noreply.github.com>

---------

Co-authored-by: David Berenstein <davidberenstein1957@users.noreply.github.com>
* Update serialization method of _BatchManager to write each of the inner steps to a file and load them back (#496)

* Update replacing string

* Add guide to the CLI

* Added CLI to api reference a small reference to that from the tutorial
* Update serialization method of _BatchManager to write each of the inner steps to a file and load them back (#496)

* Add docstrings to lost argument in Distiset

* Add section for caching in advanced tutorial
* Add `AzureOpenAILLM`

* Update `distilabel.llms` imports

* Fix `base_url` env var and add `api_version` env var

* Add `AzureOpenAILLM` to `test_imports`

* Add `TestAzureOpenAILLM`

* Fix `base_url` docstring

* Remove `together` extra and place `tests` extra properly

* Fix extras alphabetic order in `pyproject.toml`

* Update `docs/index.md` and `README.md`

* Add `docs/api/llms/azure.md`
* Update layout of steps

* Add step guide and draft of special types of steps

* Add reference for the step decorator

* Include step decorator in the tutorial

* Add intro to the different types of steps

* Add generator steps

* Update general and global steps

* Fix typos

* Missing argilla steps examples in general steps

* Create initial layout for tasks

* Add special tasks
@gabrielmbmb gabrielmbmb added the enhancement New feature or request label Apr 8, 2024
@gabrielmbmb gabrielmbmb added this to the 1.0.0 milestone Apr 8, 2024
@gabrielmbmb gabrielmbmb self-assigned this Apr 8, 2024
@gabrielmbmb gabrielmbmb changed the base branch from main to core-refactor April 8, 2024 11:09
@gabrielmbmb gabrielmbmb changed the base branch from core-refactor to new-docs April 8, 2024 11:10
@gabrielmbmb gabrielmbmb marked this pull request as ready for review April 8, 2024 11:28
@gabrielmbmb gabrielmbmb linked an issue Apr 8, 2024 that may be closed by this pull request
@alvarobartt
Copy link
Member

🚨 API Key leak @gabrielmbmb!

Base automatically changed from new-docs to core-refactor April 9, 2024 15:27
@gabrielmbmb gabrielmbmb merged commit 62caee0 into core-refactor Apr 9, 2024
4 checks passed
@gabrielmbmb gabrielmbmb deleted the cohere-llm branch April 9, 2024 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add CohereLLM
3 participants