Update ui/gpu.py
Browse files
ui/gpu.py
CHANGED
|
@@ -36,9 +36,9 @@ GPU_DEVICE = "cuda" if ON_ZEROGPU else "cpu"
|
|
| 36 |
# itself. A long paper on a cold cache is the worst case.
|
| 37 |
_VECTORIZE_SECONDS = 120
|
| 38 |
|
| 39 |
-
|
| 40 |
@spaces.GPU(duration=_VECTORIZE_SECONDS)
|
| 41 |
-
|
|
|
|
| 42 |
def vectorize_on_gpu(pdf_path: str) -> None:
|
| 43 |
"""Build and persist this paper's vectorstore with the embedder on GPU.
|
| 44 |
|
|
|
|
| 36 |
# itself. A long paper on a cold cache is the worst case.
|
| 37 |
_VECTORIZE_SECONDS = 120
|
| 38 |
|
|
|
|
| 39 |
@spaces.GPU(duration=_VECTORIZE_SECONDS)
|
| 40 |
+
zero_gpu_flag = os.environ.get("SPACES_ZERO_GPU")
|
| 41 |
+
print("[GPU FN] pid=" + str(os.getpid()) + ", in ZeroGPU ctx: " + str(zero_gpu_flag))
|
| 42 |
def vectorize_on_gpu(pdf_path: str) -> None:
|
| 43 |
"""Build and persist this paper's vectorstore with the embedder on GPU.
|
| 44 |
|