Fix Dockerfile for arm64 (#2705)

### What problem does this PR solve?

Fix Dockerfile for arm64

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
- [ ] New Feature (non-breaking change which adds functionality)
- [ ] Documentation Update
- [ ] Refactoring
- [ ] Performance Improvement
- [ ] Other (please describe):

---------

Co-authored-by: Ubuntu <ubuntu@arm-test.us-central1-f.c.ragflow-01.internal>
This commit is contained in:
Zhichang Yu
2024-10-02 19:41:56 +08:00
committed by GitHub
parent 5f4d2dc4fe
commit e46a4d1875
5 changed files with 39 additions and 11 deletions

View File

@ -3,6 +3,11 @@
from huggingface_hub import snapshot_download
import nltk
import os
import urllib.request
urls = [
"https://github.com/openssl/openssl/releases/download/OpenSSL_1_1_1w/openssl-1.1.1w.tar.gz",
]
repos = [
"InfiniFlow/text_concat_xgb_v1.0",
@ -20,10 +25,17 @@ def download_model(repo_id):
if __name__ == "__main__":
for url in urls:
filename = url.split("/")[-1]
print(f"Downloading {url}...")
if not os.path.exists(filename):
urllib.request.urlretrieve(url, filename)
local_dir = os.path.abspath('nltk_data')
for data in ['wordnet', 'punkt', 'wordnet']:
for data in ['wordnet', 'punkt', 'punkt_tab']:
print(f"Downloading nltk {data}...")
nltk.download(data, download_dir=local_dir)
for repo_id in repos:
print(f"Downloading huggingface repo {repo_id}...")
download_model(repo_id)