Skip to content

Commit 4254502

Browse files
authored
Add version check for gradio demo
1 parent 805cc7a commit 4254502

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

examples/gradio_demo.py

+9
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,15 @@
2222
import numpy as np
2323
import erniebot as eb
2424

25+
# python version need higher or equal than 3.8
26+
import sys
27+
major = sys.version_info.major
28+
minor = sys.version_info.minor
29+
if int(major) != 3 or int(minor) < 8:
30+
raise Exception(
31+
"The gradio demo requires python >= 3.8, now your python version is {}.{}.".
32+
format(major, minor))
33+
2534

2635
def setup_args():
2736
"""Setup arguments."""

0 commit comments

Comments
 (0)