|
|
--- |
|
|
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文件夹。 |