Spaces:
Build error
Build error
Download environment_setup.py from seachen/Intern_streamlit_rag: direct link, hf CLI and curl.
- Browser
- Download file 1.34 kB
-
https://huggingface.co/spaces/seachen/Intern_streamlit_rag/resolve/main/environment_setup.py
- Command line
-
hf download hf://spaces/seachen/Intern_streamlit_rag/environment_setup.py
-
curl -L -o environment_setup.py https://huggingface.co/spaces/seachen/Intern_streamlit_rag/resolve/main/environment_setup.py
1.34 kB
| # # environment_setup.py | |
| # import subprocess | |
| # import sys | |
| # import os | |
| # def install_packages(): | |
| # packages = [ | |
| # "einops==0.7.0", | |
| # "protobuf==5.26.1", | |
| # "llama-index==0.11.20", | |
| # "llama-index-llms-replicate==0.3.0", | |
| # "llama-index-llms-openai-like==0.2.0", | |
| # "llama-index-embeddings-huggingface==0.3.1", | |
| # "llama-index-embeddings-instructor==0.2.1", | |
| # "torch==2.5.0", | |
| # "torchvision==0.20.0", | |
| # "torchaudio==2.5.0" | |
| # ] | |
| # index_url = "https://download.pytorch.org/whl/cu121" # 根据你的 CUDA 版本调整 | |
| # for package in packages: | |
| # try: | |
| # if package.startswith("torch") or package.startswith("torchvision") or package.startswith("torchaudio"): | |
| # subprocess.check_call([sys.executable, "-m", "pip", "install", f"{package}", "--index-url", index_url, "-q"]) | |
| # else: | |
| # subprocess.check_call([sys.executable, "-m", "pip", "install", f"{package}", "-q"]) | |
| # print(f"Successfully installed {package}") | |
| # except subprocess.CalledProcessError as e: | |
| # print(f"Error installing {package}: {e}") | |
| # if __name__ == "__main__": | |
| # print("Starting to install required packages...") | |
| # install_packages() | |
| # print("Package installation completed.") | |