speech-test commited on
Commit
7084126
β€’
1 Parent(s): f0dfc26

disable tqdm logging

Browse files
Files changed (1) hide show
  1. app.py +5 -0
app.py CHANGED
@@ -1,11 +1,16 @@
1
  import random
2
  import torch
 
 
3
  import gradio as gr
4
  from gradio.mix import Series
5
  from transformers import pipeline
6
  from rudalle.pipelines import generate_images
7
  from rudalle import get_rudalle_model, get_tokenizer, get_vae
8
 
 
 
 
9
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
10
  translation_pipe = pipeline("translation", model="facebook/wmt19-en-ru", device=0)
11
  dalle = get_rudalle_model("Malevich", pretrained=True, fp16=True, device=device)
 
1
  import random
2
  import torch
3
+ from tqdm import tqdm
4
+ from functools import partialmethod
5
  import gradio as gr
6
  from gradio.mix import Series
7
  from transformers import pipeline
8
  from rudalle.pipelines import generate_images
9
  from rudalle import get_rudalle_model, get_tokenizer, get_vae
10
 
11
+ # disable tqdm logging from the rudalle pipeline
12
+ tqdm.__init__ = partialmethod(tqdm.__init__, disable=True)
13
+
14
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
15
  translation_pipe = pipeline("translation", model="facebook/wmt19-en-ru", device=0)
16
  dalle = get_rudalle_model("Malevich", pretrained=True, fp16=True, device=device)