Skip to content

Commit 236685d

Browse files
mohseninimadechamps
authored andcommitted
Fixed google colab check
google colab changed some things and the check for testing if the notebook was running in colab would fail Move the running_in_colab into the try catch block
1 parent 08345d9 commit 236685d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Loudspeaker_Explorer.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,11 @@ import pathlib
8888
import re
8989
import textwrap
9090

91-
running_in_colab = 'COLAB_GPU' in os.environ
91+
try:
92+
import google.colab
93+
running_in_colab = True
94+
except:
95+
running_in_colab = False
9296

9397
if LOUDSPEAKER_EXPLORER_PRERENDERED_GIT_SHA is not None and running_in_colab:
9498
def read_git_sha(directory):

0 commit comments

Comments
 (0)