[Python] ragas with Ollama does not terminate

Discussão em 'Python' iniciado por Stack, Agosto 29, 2025.

  1. Stack

    Stack Membro Participativo

    I am using the python package ragas with the goal of generating a testset for a RAG application.

    I am defining my BaseRagasLLM as:

    from langchain_ollama import OllamaLLM
    from ragas.llms import LangchainLLMWrapper
    from ragas.testset.graph import Node, NodeType, KnowledgeGraph
    from constants import MARKDOWN_BOOKS_DIR
    from clients.llm import LLM

    ollama_llm = OllamaLLM(
    model = "llama3.2:1b",
    temperature = 0,
    base_url = "http://localhost:11434",
    )
    ragas_llm = LangchainLLMWrapper(langchain_llm = ollama_llm)


    But when running a Transform the script always hangs in the last node of the KnowledgeGraph:

    theme_extractor = ThemesExtractor(
    llm=ragas_llm,
    property_name="themes",
    max_num_themes = 3
    )
    apply_transforms(kg, transforms=[theme_extractor])


    Even when I run it as:

    await theme_extractor.transform(kg=kg)


    I still have the same issue.

    How can I debug this?

    Continue reading...

Compartilhe esta Página