Download framework/vectorstore/utils.go from shimen/yapapaway: direct link, hf CLI and curl.
- Browser
- Download file 342 Bytes
-
https://huggingface.co/spaces/shimen/yapapaway/resolve/main/framework/vectorstore/utils.go
- Command line
-
hf download hf://spaces/shimen/yapapaway/framework/vectorstore/utils.go
-
curl -L -o utils.go https://huggingface.co/spaces/shimen/yapapaway/resolve/main/framework/vectorstore/utils.go
342 Bytes
| package vectorstore | |
| import ( | |
| "context" | |
| "time" | |
| ) | |
| // withTimeout adds a timeout to the context if it is set. | |
| func withTimeout(ctx context.Context, timeout time.Duration) (context.Context, context.CancelFunc) { | |
| if timeout > 0 { | |
| return context.WithTimeout(ctx, timeout) | |
| } | |
| // No-op cancel to simplify call sites. | |
| return ctx, func() {} | |
| } | |