jannisborn commited on
Commit
11b4f29
1 Parent(s): fbaddc2
Files changed (2) hide show
  1. app.py +4 -1
  2. model_cards/article.md +1 -1
app.py CHANGED
@@ -19,7 +19,10 @@ logger.addHandler(logging.NullHandler())
19
 
20
  def run_inference(model_type: str, prompt: str):
21
 
22
- config = eval(f"{model_type}(prompt={prompt})")
 
 
 
23
  if config.modality != "token2image" and prompt != "":
24
  raise ValueError(
25
  f"{model_type} is an unconditional generative model, please remove prompt (not={prompt})"
 
19
 
20
  def run_inference(model_type: str, prompt: str):
21
 
22
+ if prompt == "":
23
+ config = eval(f"{model_type}()")
24
+ else:
25
+ config = eval(f"{model_type}(prompt={prompt})")
26
  if config.modality != "token2image" and prompt != "":
27
  raise ValueError(
28
  f"{model_type} is an unconditional generative model, please remove prompt (not={prompt})"
model_cards/article.md CHANGED
@@ -15,6 +15,7 @@
15
  - `DDPMGenerator`
16
  - `LDMGenerator`
17
  - `ScoreSdeGenerator`
 
18
  For details, see the [Diffusers docs](https://huggingface.co/docs/diffusers/index)
19
 
20
  **Developers**: Various developers of above models, wrapped by Diffusers developers into [`diffusers`](https://github.com/huggingface/diffusers)
@@ -54,7 +55,6 @@ N.A.
54
  Model card prototype inspired by [Mitchell et al. (2019)](https://dl.acm.org/doi/abs/10.1145/3287560.3287596?casa_token=XD4eHiE2cRUAAAAA:NL11gMa1hGPOUKTAbtXnbVQBDBbjxwcjGECF_i-WC_3g1aBgU1Hbz_f2b4kI_m1in-w__1ztGeHnwHs)
55
 
56
  ## Citation
57
- TBD, temporarily please cite:
58
  ```bib
59
  @misc{von-platen-etal-2022-diffusers,
60
  author = {Patrick von Platen and Suraj Patil and Anton Lozhkov and Pedro Cuenca and Nathan Lambert and Kashif Rasul and Mishig Davaadorj and Thomas Wolf},
 
15
  - `DDPMGenerator`
16
  - `LDMGenerator`
17
  - `ScoreSdeGenerator`
18
+
19
  For details, see the [Diffusers docs](https://huggingface.co/docs/diffusers/index)
20
 
21
  **Developers**: Various developers of above models, wrapped by Diffusers developers into [`diffusers`](https://github.com/huggingface/diffusers)
 
55
  Model card prototype inspired by [Mitchell et al. (2019)](https://dl.acm.org/doi/abs/10.1145/3287560.3287596?casa_token=XD4eHiE2cRUAAAAA:NL11gMa1hGPOUKTAbtXnbVQBDBbjxwcjGECF_i-WC_3g1aBgU1Hbz_f2b4kI_m1in-w__1ztGeHnwHs)
56
 
57
  ## Citation
 
58
  ```bib
59
  @misc{von-platen-etal-2022-diffusers,
60
  author = {Patrick von Platen and Suraj Patil and Anton Lozhkov and Pedro Cuenca and Nathan Lambert and Kashif Rasul and Mishig Davaadorj and Thomas Wolf},