File size: 892 Bytes
a465481 c83de06 2e50aee c83de06 2e50aee c83de06 7c4b04a c83de06 2e50aee c83de06 eb2338a c83de06 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
---
license: apache-2.0
---
## 创建环境
```
git clone git@hf.co:yujuanqin/test_mlx
cd test_mlx
git clone git@hf.co:mvp1024/mlx-app-pack mlx_app # 需要huggingface mvp1024 权限
conda create test_mlx python=3.10
conda activate test_mlx
pip install -r mlx_app/requirements.txt
```
需要修改 mlx_app 中的一些代码以避免网络请求:
- mlx_app/stable_diffusion/model_io.py: 将所有使用 hf_hub_download 的代码注释掉,改为使用 get_file_path; 修改 get_file_path 里的路径`return os.path.join("../models", key, val)`
- mlx_app/txt2image_lora.py: 88 行,改为`unet_config = f"../models/{repo_id}/{_MODELS[repo_id]['unet_config']}"`
## 下载模型
```
python download_models.py
```
## 运行测试脚本
```
python test_mlx.py
```
## 收集测试结果
测试结果在 result_mlx.csv,生成的图片保存在当前目录下的base_model_images文件夹。 |