Download deployment/space/client.js from Wizzas/DefectRAG: direct link, hf CLI and curl.
- Browser
- Download file 440 Bytes
-
https://huggingface.co/Wizzas/DefectRAG/resolve/main/deployment/space/client.js
- Command line
-
hf download hf://Wizzas/DefectRAG/deployment/space/client.js
-
curl -L -o client.js https://huggingface.co/Wizzas/DefectRAG/resolve/main/deployment/space/client.js
440 Bytes
| import {Client} from '@gradio/client'; | |
| export {Client}; | |
| export function closeClient(client){ | |
| // predict() resolves on process_completed, before the SSE reader necessarily | |
| // finishes. An intentional abort is normal disposal, not a failed model job. | |
| const stream=client.stream_instance; | |
| if(stream){ | |
| const onerror=stream.onerror; | |
| stream.onerror=error=>{if(error?.name!=='AbortError')onerror?.(error)}; | |
| } | |
| client.close(); | |
| } | |