ai-forever / ai-forever/gigachat

Не работает вместе с ragas

Abierto
#31 0 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Python
Estrellas
168
Forks
45
Merge medio
1 min
PR fusionados (30 d)
1

Descripción

Пытаюсь провалидировать колонки датафрейма но выдает ошибку

```
import pandas as pd
import numpy as np
from langchain.chat_models.gigachat import GigaChat

import pandas as pd
from ragas.embeddings import HuggingfaceEmbeddings

hf_embeddings = HuggingfaceEmbeddings(model_name="e5-large")

df = pd.read_excel('/content/pds_valid_prompts.xlsx')

llm = GigaChat(user = 'user', password = 'password',model='GigaChat-Pro',profanity_check=False, verify_ssl_certs=False)
```
логи
```
Exception in thread Thread-11:
Traceback (most recent call last):
File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
self.run()
File "/usr/local/lib/python3.10/dist-packages/ragas/executor.py", line 87, in run
results = self.loop.run_until_complete(self._aresults())
File "/usr/lib/python3.10/asyncio/base_events.py", line 625, in run_until_complete
self._check_running()
File "/usr/lib/python3.10/asyncio/base_events.py", line 584, in _check_running
raise RuntimeError('This event loop is already running')
RuntimeError: This event loop is already running
/usr/lib/python3.10/threading.py:1018: RuntimeWarning: coroutine 'Runner._aresults' was never awaited
self._invoke_excepthook(self)
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
/usr/local/lib/python3.10/dist-packages/ragas/evaluation.py:235: RuntimeWarning: coroutine 'as_completed..sema_coro' was never awaited
results = executor.results()
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
---------------------------------------------------------------------------
ExceptionInRunner Traceback (most recent call last)
[](https://localhost:8080/#) in ()
11
12 dataset = Dataset.from_dict(data_samples)
---> 13 score = evaluate(dataset,llm=llm, embeddings = hf_embeddings, raise_exceptions=False, metrics=[answer_relevancy])
14 score.to_pandas()

1 frames
[/usr/local/lib/python3.10/dist-packages/ragas/evaluation.py](https://localhost:8080/#) in evaluate(dataset, metrics, llm, embeddings, callbacks, in_ci, is_async, run_config, raise_exceptions, column_map)
253 evaluation_rm.on_chain_error(e)
254
--> 255 raise e
256 else:
257 result = Result(

[/usr/local/lib/python3.10/dist-packages/ragas/evaluation.py](https://localhost:8080/#) in evaluate(dataset, metrics, llm, embeddings, callbacks, in_ci, is_async, run_config, raise_exceptions, column_map)
235 results = executor.results()
236 if results == []:
--> 237 raise ExceptionInRunner()
238
239 # convert results to dataset_like

ExceptionInRunner: The runner thread which was running the jobs raised an exeception. Read the traceback above to debug it. You can also pass `raise_exceptions=False` incase you want to show only a warning message instead.
```

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.