-
Notifications
You must be signed in to change notification settings - Fork 453
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
Custom LLM in the docs provide no schema input for generate method, and returns string, which causes summarization.py raise AttributeError: 'str' object has no attribute 'truths' #1420
Comments
@pin-lpt-heatherwick because you didn't return a pydantic |
I tried using the doc as is already as below
which raises the error below Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): |
@pin-lpt-heatherwick hmm i see, let me check back to you tomorrow on this metric, thanks for flagging it |
`from deepeval.models.base_model import DeepEvalBaseLLM
class Mistral7B(DeepEvalBaseLLM):
def init(
self,
model,
tokenizer
):
self.model = model
self.tokenizer = tokenizer
Traceback (most recent call last):
File "/home/user/.pyenv/versions/3.10.16/lib/python3.10/site-packages/gradio/queueing.py", line 625, in process_events
response = await route_utils.call_process_api(
File "/home/user/.pyenv/versions/3.10.16/lib/python3.10/site-packages/gradio/route_utils.py", line 322, in call_process_api
output = await app.get_blocks().process_api(
File "/home/user/.pyenv/versions/3.10.16/lib/python3.10/site-packages/gradio/blocks.py", line 2108, in process_api
result = await self.call_function(
File "/home/user/.pyenv/versions/3.10.16/lib/python3.10/site-packages/gradio/blocks.py", line 1655, in call_function
prediction = await anyio.to_thread.run_sync( # type: ignore
File "/home/user/.pyenv/versions/3.10.16/lib/python3.10/site-packages/anyio/to_thread.py", line 56, in run_sync
return await get_async_backend().run_sync_in_worker_thread(
File "/home/user/.pyenv/versions/3.10.16/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 2461, in run_sync_in_worker_thread
return await future
File "/home/user/.pyenv/versions/3.10.16/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 962, in run
result = context.run(func, *args)
File "/home/user/.pyenv/versions/3.10.16/lib/python3.10/site-packages/gradio/utils.py", line 890, in wrapper
response = f(*args, **kwargs)
File "/home/user/app/app.py", line 66, in run_metric
metric.measure(test_case)
File "/home/user/app/deepeval/metrics/summarization/summarization.py", line 76, in measure
loop.run_until_complete(
File "/home/user/.pyenv/versions/3.10.16/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
return future.result()
File "/home/user/app/deepeval/metrics/summarization/summarization.py", line 128, in a_measure
self.truths, self.claims = await asyncio.gather(
File "/home/user/app/deepeval/metrics/summarization/summarization.py", line 489, in _a_generate_truths
return res.truths
AttributeError: 'str' object has no attribute 'truths'
The text was updated successfully, but these errors were encountered: