fix: pin diffusers and update converter compatibility

#6
by michellehbn HF Staff - opened
Files changed (4) hide show
  1. README.md +2 -1
  2. app.py +4 -3
  3. convert.py +2 -3
  4. requirements.txt +1 -1
README.md CHANGED
@@ -4,7 +4,8 @@ emoji: 🎨➡️🧨
4
  colorFrom: indigo
5
  colorTo: purple
6
  sdk: gradio
7
- sdk_version: 3.31.0
 
8
  app_file: app.py
9
  pinned: true
10
  license: mit
 
4
  colorFrom: indigo
5
  colorTo: purple
6
  sdk: gradio
7
+ sdk_version: 6.27.0
8
+ python_version: "3.13"
9
  app_file: app.py
10
  pinned: true
11
  license: mit
app.py CHANGED
@@ -17,7 +17,7 @@ The steps are the following:
17
  demo = gr.Interface(
18
  title="Convert any Stable Diffusion XL checkpoint to Diffusers and open a PR",
19
  description=DESCRIPTION,
20
- allow_flagging="never",
21
  article="Check out the [Diffusers repo on GitHub](https://github.com/huggingface/diffusers)",
22
  inputs=[
23
  gr.Text(max_lines=1, label="your_hf_token"),
@@ -26,6 +26,7 @@ demo = gr.Interface(
26
  ],
27
  outputs=[gr.Markdown(label="output")],
28
  fn=convert,
29
- ).queue(max_size=10, concurrency_count=1)
 
30
 
31
- demo.launch(show_api=True)
 
17
  demo = gr.Interface(
18
  title="Convert any Stable Diffusion XL checkpoint to Diffusers and open a PR",
19
  description=DESCRIPTION,
20
+ flagging_mode="never",
21
  article="Check out the [Diffusers repo on GitHub](https://github.com/huggingface/diffusers)",
22
  inputs=[
23
  gr.Text(max_lines=1, label="your_hf_token"),
 
26
  ],
27
  outputs=[gr.Markdown(label="output")],
28
  fn=convert,
29
+ concurrency_limit=1,
30
+ ).queue(max_size=10)
31
 
32
+ demo.launch()
convert.py CHANGED
@@ -58,12 +58,11 @@ def convert(token: str, model_id: str, filename: str, progress=gr.Progress()):
58
  folder = convert_single(model_id, filename, folder, progress, token)
59
  progress(0.7, desc="Uploading to Hub")
60
  new_pr = api.upload_folder(folder_path=folder, path_in_repo="./", repo_id=model_id, repo_type="model", token=token, commit_message=pr_title, commit_description=COMMIT_MESSAGE.format(model_id), create_pr=True)
61
- pr_number = new_pr.split("%2F")[-1].split("/")[0]
62
- link = f"Pr created at: {'https://huggingface.co/' + os.path.join(model_id, 'discussions', pr_number)}"
63
  progress(1, desc="Done")
64
  except Exception as e:
65
  raise gr.exceptions.Error(str(e))
66
  finally:
67
  shutil.rmtree(folder)
68
 
69
- return link
 
58
  folder = convert_single(model_id, filename, folder, progress, token)
59
  progress(0.7, desc="Uploading to Hub")
60
  new_pr = api.upload_folder(folder_path=folder, path_in_repo="./", repo_id=model_id, repo_type="model", token=token, commit_message=pr_title, commit_description=COMMIT_MESSAGE.format(model_id), create_pr=True)
61
+ link = f"Pr created at: {new_pr.pr_url}"
 
62
  progress(1, desc="Done")
63
  except Exception as e:
64
  raise gr.exceptions.Error(str(e))
65
  finally:
66
  shutil.rmtree(folder)
67
 
68
+ return link
requirements.txt CHANGED
@@ -2,6 +2,6 @@ huggingface_hub
2
  safetensors
3
  transformers
4
  accelerate
5
- git+https://github.com/huggingface/diffusers
6
  omegaconf
7
  pytorch_lightning
 
2
  safetensors
3
  transformers
4
  accelerate
5
+ diffusers==0.40.0
6
  omegaconf
7
  pytorch_lightning