Spaces:
Sleeping
Sleeping
Download graph/nodes/generate.py from mikail-bitik/CorrectiveRAGProject: direct link, hf CLI and curl.
- Browser
- Download file 450 Bytes
-
https://huggingface.co/spaces/mikail-bitik/CorrectiveRAGProject/resolve/main/graph/nodes/generate.py
- Command line
-
hf download hf://spaces/mikail-bitik/CorrectiveRAGProject/graph/nodes/generate.py
-
curl -L -o generate.py https://huggingface.co/spaces/mikail-bitik/CorrectiveRAGProject/resolve/main/graph/nodes/generate.py
450 Bytes
| from graph.chains.generation import generation_chain | |
| from graph.state import GraphState | |
| from typing import Dict, Any | |
| def generate(state: GraphState) -> Dict[str, Any]: | |
| print("----GENERATE----") | |
| question = state["question"] | |
| documents = state["documents"] | |
| generation = generation_chain.invoke( | |
| {"context": documents, "question":question} | |
| ) | |
| return {"question":question, "documents":documents, "generation":generation} |