Spaces:
Runtime error
Runtime error
Factor Studios
commited on
Update torch_vgpu.py
Browse files- torch_vgpu.py +0 -7
torch_vgpu.py
CHANGED
|
@@ -287,13 +287,6 @@ def to_vgpu(tensor, vram=None):
|
|
| 287 |
device._to_vram(result)
|
| 288 |
return result
|
| 289 |
|
| 290 |
-
def create_compatible_device_map(device_spec):
|
| 291 |
-
"""Create a device map that's compatible with Transformers"""
|
| 292 |
-
if isinstance(device_spec, str) and device_spec.startswith('vgpu'):
|
| 293 |
-
# For model loading, use CPU but track vGPU intent
|
| 294 |
-
return "cpu"
|
| 295 |
-
return device_spec
|
| 296 |
-
|
| 297 |
# Create a proper device class that extends torch.device behavior
|
| 298 |
class VGPUDeviceWrapper(torch.device):
|
| 299 |
"""Extended device class that handles vGPU devices while maintaining torch.device compatibility"""
|
|
|
|
| 287 |
device._to_vram(result)
|
| 288 |
return result
|
| 289 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 290 |
# Create a proper device class that extends torch.device behavior
|
| 291 |
class VGPUDeviceWrapper(torch.device):
|
| 292 |
"""Extended device class that handles vGPU devices while maintaining torch.device compatibility"""
|