Spaces:
Sleeping
Sleeping
Download test_stream.py from Subhadip007/researchpilot-api: direct link, hf CLI and curl.
- Browser
- Download file 314 Bytes
-
https://huggingface.co/spaces/Subhadip007/researchpilot-api/resolve/32cff2fe35cc30459a152fcc741e0401a4dff1a6/test_stream.py
- Command line
-
hf download hf://spaces/Subhadip007/researchpilot-api@32cff2fe35cc30459a152fcc741e0401a4dff1a6/test_stream.py
-
curl -L -o test_stream.py https://huggingface.co/spaces/Subhadip007/researchpilot-api/resolve/32cff2fe35cc30459a152fcc741e0401a4dff1a6/test_stream.py
314 Bytes
| import os | |
| import sys | |
| from dotenv import load_dotenv | |
| load_dotenv() | |
| sys.path.append(os.getcwd()) | |
| from src.rag.pipeline import RAGPipeline | |
| try: | |
| pipeline = RAGPipeline() | |
| gen = pipeline.stream_query("What is LoRA?", top_k=2) | |
| for x in gen: | |
| print(x) | |
| except Exception as e: | |
| print(f"Error: {e}") | |