Spaces:
Configuration error
Configuration error
Download app/generation/context_builder.py from Samaksh25/GST_RAG_BACKEND: direct link, hf CLI and curl.
- Browser
- Download file 224 Bytes
-
https://huggingface.co/spaces/Samaksh25/GST_RAG_BACKEND/resolve/main/app/generation/context_builder.py
- Command line
-
hf download hf://spaces/Samaksh25/GST_RAG_BACKEND/app/generation/context_builder.py
-
curl -L -o context_builder.py https://huggingface.co/spaces/Samaksh25/GST_RAG_BACKEND/resolve/main/app/generation/context_builder.py
224 Bytes
| def build_context(chunks: list[dict]) -> str: | |
| context = [] | |
| for c in chunks: | |
| context.append( | |
| f"[Source: {c['source']}, Page: {c.get('page')}]\n{c['text']}" | |
| ) | |
| return "\n\n".join(context) |