distilabel
distilabel copied to clipboard
Unable to use OPENAILLM class with docker hosted vllm
Wrote the according to the following example at https://distilabel.argilla.io/latest/sections/how_to_guides/advanced/serving_an_llm_for_reuse/#serving-llms-using-vllm:
from distilabel.llms import OpenAILLM
from distilabel.pipeline import Pipeline
from distilabel.steps import LoadDataFromDicts
from distilabel.steps.tasks import TextGeneration, UltraFeedback
with Pipeline(name="serving-llm") as pipeline:
load_data = LoadDataFromDicts(
data=[{"instruction": "Write a poem about the sun and moon."}]
)
# `base_url` points to the address of the `vLLM` serving the LLM
llm = OpenAILLM(base_url="http://192.168.1.138:8000", model="")
text_generation = TextGeneration(
llm=llm,
num_generations=3,
group_generations=True,
output_mappings={"generation": "generations"},
)
ultrafeedback = UltraFeedback(aspect="overall-rating", llm=llm)
load_data >> text_generation >> ultrafeedback
Running in to the following error :
WARNING ['distilabel.step.paraphrase_validation'] Subprocess traceback: step_wrapper.py:245
Traceback (most recent call last):
File "/home/gpuwork/LLM-Postraining-Synthetic-data-generation/venv/lib/python3.10/site-packages/distilabel/pipeline/step_wrapper.py", line 229, in _non_generator_process_loop
result = next(step.process_applying_mappings(*batch.data))
File "/home/gpuwork/LLM-Postraining-Synthetic-data-generation/venv/lib/python3.10/site-packages/distilabel/steps/base.py", line 642, in process_applying_mappings
for output_rows in generator:
File "/home/gpuwork/LLM-Postraining-Synthetic-data-generation/venv/lib/python3.10/site-packages/distilabel/steps/tasks/base.py", line 267, in process
outputs = self.llm.generate(
File "/home/gpuwork/LLM-Postraining-Synthetic-data-generation/venv/lib/python3.10/site-packages/distilabel/llms/base.py", line 358, in generate
return self.event_loop.run_until_complete(
File "/usr/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
return future.result()
File "/home/gpuwork/LLM-Postraining-Synthetic-data-generation/venv/lib/python3.10/site-packages/distilabel/llms/base.py", line 328, in _agenerate
return await asyncio.gather(*tasks)
File "/home/gpuwork/LLM-Postraining-Synthetic-data-generation/venv/lib/python3.10/site-packages/distilabel/llms/openai.py", line 268, in agenerate
completion = await self._aclient.chat.completions.create(**kwargs) # type: ignore
File "/home/gpuwork/LLM-Postraining-Synthetic-data-generation/venv/lib/python3.10/site-packages/openai/resources/chat/completions.py", line 1339, in create
return await self._post(
File "/home/gpuwork/LLM-Postraining-Synthetic-data-generation/venv/lib/python3.10/site-packages/openai/_base_client.py", line 1816, in post
return await self.request(cast_to, opts, stream=stream, stream_cls=stream_cls)
File "/home/gpuwork/LLM-Postraining-Synthetic-data-generation/venv/lib/python3.10/site-packages/openai/_base_client.py", line 1510, in request
return await self._request(
File "/home/gpuwork/LLM-Postraining-Synthetic-data-generation/venv/lib/python3.10/site-packages/openai/_base_client.py", line 1611, in _request
raise self._make_status_error_from_response(err.response) from None
openai.NotFoundError: Error code: 404 - {'object': 'error', 'message': 'The model `` does not exist.', 'type': 'NotFoundError', 'param': None, 'code': 404}
The example explicitly mentions to keep the model name blank as ''