Spaces:
Runtime error
Runtime error
add execution permission to tikal.sh
Browse files
setup.py
CHANGED
|
@@ -3,7 +3,7 @@ import shutil
|
|
| 3 |
import zipfile
|
| 4 |
import subprocess
|
| 5 |
import requests
|
| 6 |
-
|
| 7 |
import sys
|
| 8 |
|
| 9 |
from git import Repo
|
|
@@ -69,6 +69,7 @@ def main():
|
|
| 69 |
|
| 70 |
url = "https://okapiframework.org/binaries/main/1.47.0/okapi-apps_gtk2-linux-x86_64_1.47.0.zip"
|
| 71 |
outfile = "okapi-apps_gtk2-linux-x86_64_1.47.0.zip"
|
|
|
|
| 72 |
|
| 73 |
print("Downloading Okapi Tikal...")
|
| 74 |
with requests.get(url, stream=True) as r:
|
|
@@ -79,9 +80,14 @@ def main():
|
|
| 79 |
|
| 80 |
print("Unzipping Okapi Tikal...")
|
| 81 |
with zipfile.ZipFile(outfile, "r") as z:
|
| 82 |
-
z.extractall(
|
| 83 |
|
| 84 |
os.remove(outfile)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 85 |
|
| 86 |
# -------------------------------------------------------------------
|
| 87 |
# 4. Install PspaCy model
|
|
|
|
| 3 |
import zipfile
|
| 4 |
import subprocess
|
| 5 |
import requests
|
| 6 |
+
import stat
|
| 7 |
import sys
|
| 8 |
|
| 9 |
from git import Repo
|
|
|
|
| 69 |
|
| 70 |
url = "https://okapiframework.org/binaries/main/1.47.0/okapi-apps_gtk2-linux-x86_64_1.47.0.zip"
|
| 71 |
outfile = "okapi-apps_gtk2-linux-x86_64_1.47.0.zip"
|
| 72 |
+
outfolder = "okapi-apps_gtk2-linux-x86_64_1.47.0"
|
| 73 |
|
| 74 |
print("Downloading Okapi Tikal...")
|
| 75 |
with requests.get(url, stream=True) as r:
|
|
|
|
| 80 |
|
| 81 |
print("Unzipping Okapi Tikal...")
|
| 82 |
with zipfile.ZipFile(outfile, "r") as z:
|
| 83 |
+
z.extractall(outfolder)
|
| 84 |
|
| 85 |
os.remove(outfile)
|
| 86 |
+
tikal_file = os.path.join(outfolder, "tikal.sh")
|
| 87 |
+
current_permissions = os.stat(tikal_file).st_mode
|
| 88 |
+
|
| 89 |
+
# Add execute permissions for user, group, and others
|
| 90 |
+
os.chmod(tikal_file, current_permissions | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH)
|
| 91 |
|
| 92 |
# -------------------------------------------------------------------
|
| 93 |
# 4. Install PspaCy model
|