Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -32,8 +32,13 @@ torch_dtype = torch.bfloat16 # Set the appropriate torch data type
|
|
32 |
|
33 |
# Display device and CPU thread information
|
34 |
device = get_device()
|
35 |
-
print("
|
36 |
-
print("
|
|
|
|
|
|
|
|
|
|
|
37 |
|
38 |
# Load tokenizer
|
39 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
|
|
32 |
|
33 |
# Display device and CPU thread information
|
34 |
device = get_device()
|
35 |
+
print(f"Number of GPUs available: {torch.cuda.device_count()}")
|
36 |
+
print(f"Running on device: {device}")
|
37 |
+
print(f"CPU threads: {torch.get_num_threads()}")
|
38 |
+
|
39 |
+
# Check if CUDA is available and set the device accordingly
|
40 |
+
if not torch.cuda.is_available():
|
41 |
+
raise RuntimeError("CUDA is not available. Ensure that a GPU is available and properly configured.")
|
42 |
|
43 |
# Load tokenizer
|
44 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|