Spaces:
Runtime error
Runtime error
Commit ·
2986a2f
1
Parent(s): a791790
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,7 +3,6 @@ from transformers import pipeline
|
|
| 3 |
import multiprocessing
|
| 4 |
import torch
|
| 5 |
import os
|
| 6 |
-
from google.colab import output, drive
|
| 7 |
from psutil import virtual_memory
|
| 8 |
from pathlib import Path
|
| 9 |
import random
|
|
@@ -19,8 +18,18 @@ from pathlib import Path
|
|
| 19 |
import csv
|
| 20 |
import logging
|
| 21 |
import requests
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
|
| 23 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
|
| 25 |
|
| 26 |
pipeline = pipeline(task="image-classification", model="julien-c/hotdog-not-hotdog")
|
|
|
|
| 3 |
import multiprocessing
|
| 4 |
import torch
|
| 5 |
import os
|
|
|
|
| 6 |
from psutil import virtual_memory
|
| 7 |
from pathlib import Path
|
| 8 |
import random
|
|
|
|
| 18 |
import csv
|
| 19 |
import logging
|
| 20 |
import requests
|
| 21 |
+
from rudalle.pipelines import generate_images, show, super_resolution, cherry_pick_by_ruclip
|
| 22 |
+
from rudalle import get_rudalle_model, get_tokenizer, get_vae, get_realesrgan
|
| 23 |
+
from rudalle.utils import seed_everything
|
| 24 |
+
from ruclip import load as get_ruclip
|
| 25 |
|
| 26 |
+
# prepare models:
|
| 27 |
+
device = 'cuda'
|
| 28 |
+
model = get_rudalle_model('Malevich', pretrained=True, fp16=True, device=device)
|
| 29 |
+
tokenizer = get_tokenizer()
|
| 30 |
+
vae = get_vae(dwt=True).to(device)
|
| 31 |
+
|
| 32 |
+
#device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
|
| 33 |
|
| 34 |
|
| 35 |
pipeline = pipeline(task="image-classification", model="julien-c/hotdog-not-hotdog")
|