完整代码为
here
.
基本上是试图加载一个用LoRa和csv文档进行微调的模型进行查询。CUDA对于一个只有1.6Mb的文档来说需要荒谬的内存量。
所有加载都很好,直到最后一行:
a = chain.run(input_documents=docs, question=query)
当它产生:
torch.cuda.OutOfMemoryError: CUDA out of memory.
Tried to allocate 1207.54 GiB (GPU 0; 14.62 GiB total capacity; 11.04 GiB already allocated; 2.79 GiB free; 11.32 GiB reserved in total by PyTorch)
If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation.
See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF
有什么问题吗?有没有什么方法可以让我在不需要获得所有内存的情况下完成这次跑步?