mirror of
https://github.com/gradio-app/gradio.git
synced 2025-03-07 11:46:51 +08:00
prevent while loop using 100% cpu
This commit is contained in:
parent
47118e62a3
commit
1afbca27e0
@ -411,8 +411,8 @@ class Interface:
|
|||||||
|
|
||||||
def run_until_interrupted(self, thread, path_to_local_server):
|
def run_until_interrupted(self, thread, path_to_local_server):
|
||||||
try:
|
try:
|
||||||
while 1:
|
while True:
|
||||||
pass
|
time.sleep(0.5)
|
||||||
except (KeyboardInterrupt, OSError):
|
except (KeyboardInterrupt, OSError):
|
||||||
print("Keyboard interruption in main thread... closing server.")
|
print("Keyboard interruption in main thread... closing server.")
|
||||||
thread.keep_running = False
|
thread.keep_running = False
|
||||||
|
@ -6,7 +6,7 @@ old_version=$(grep -Po "(?<=version=')[^']+(?=')" setup.py)
|
|||||||
echo "Current version is $old_version. New version?"
|
echo "Current version is $old_version. New version?"
|
||||||
read new_version
|
read new_version
|
||||||
sed -i "s/version='$old_version'/version='$new_version'/g" setup.py
|
sed -i "s/version='$old_version'/version='$new_version'/g" setup.py
|
||||||
echo $new_version > gradio/version.txt
|
|
||||||
read -p "npm build? " -n 1 -r
|
read -p "npm build? " -n 1 -r
|
||||||
if [[ $REPLY =~ ^[Yy]$ ]]
|
if [[ $REPLY =~ ^[Yy]$ ]]
|
||||||
then
|
then
|
||||||
@ -15,7 +15,13 @@ then
|
|||||||
cd ..
|
cd ..
|
||||||
fi
|
fi
|
||||||
|
|
||||||
aws s3 cp gradio/frontend s3://gradio/$new_version/ --recursive
|
read -p "frontend updates? " -n 1 -r
|
||||||
|
if [[ $REPLY =~ ^[Yy]$ ]]
|
||||||
|
then
|
||||||
|
aws s3 cp gradio/frontend s3://gradio/$new_version/ --recursive
|
||||||
|
echo $new_version > gradio/version.txt
|
||||||
|
fi
|
||||||
|
|
||||||
rm -r dist/*
|
rm -r dist/*
|
||||||
rm -r build/*
|
rm -r build/*
|
||||||
python setup.py sdist bdist_wheel
|
python setup.py sdist bdist_wheel
|
||||||
|
Loading…
Reference in New Issue
Block a user