Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -5,6 +5,11 @@ import paddlehub as hub
|
|
5 |
import urllib
|
6 |
import cv2
|
7 |
|
|
|
|
|
|
|
|
|
|
|
8 |
import io
|
9 |
from os import path
|
10 |
from pydub import AudioSegment
|
@@ -13,13 +18,8 @@ from moviepy.editor import *
|
|
13 |
import mutagen
|
14 |
from mutagen.mp3 import MP3
|
15 |
|
16 |
-
#text_to_img = gr.Blocks.load(name="spaces/DGSpitzer/ERNIE-ViLG", api_key = os.environ.get("hf"))
|
17 |
-
text_to_img = gr.Blocks.load(name="spaces/PaddlePaddle/ERNIE-ViLG")
|
18 |
img_to_text = gr.Blocks.load(name="spaces/pharma/CLIP-Interrogator")
|
19 |
-
text_to_music = gr.Interface.load("spaces/fffiloni/text-2-music")
|
20 |
|
21 |
-
model = hub.Module(name='ernie_vilg', ak = os.environ.get("ak"), sk = os.environ.get("sk"))
|
22 |
-
#model = hub.Module(name='ernie_vilg')
|
23 |
language_translation_model = hub.Module(name='baidu_translate')
|
24 |
language_recognition_model = hub.Module(name='baidu_language_recognition')
|
25 |
|
@@ -32,6 +32,11 @@ tips = {"en": "Tips: The input text will be translated into Chinese for generati
|
|
32 |
|
33 |
count = 0
|
34 |
|
|
|
|
|
|
|
|
|
|
|
35 |
def translate_language_example(text_prompts, style_indx):
|
36 |
return translate_language(text_prompts)
|
37 |
|
|
|
5 |
import urllib
|
6 |
import cv2
|
7 |
|
8 |
+
import torch
|
9 |
+
|
10 |
+
from spectro import wav_bytes_from_spectrogram_image
|
11 |
+
from diffusers import StableDiffusionPipeline
|
12 |
+
|
13 |
import io
|
14 |
from os import path
|
15 |
from pydub import AudioSegment
|
|
|
18 |
import mutagen
|
19 |
from mutagen.mp3 import MP3
|
20 |
|
|
|
|
|
21 |
img_to_text = gr.Blocks.load(name="spaces/pharma/CLIP-Interrogator")
|
|
|
22 |
|
|
|
|
|
23 |
language_translation_model = hub.Module(name='baidu_translate')
|
24 |
language_recognition_model = hub.Module(name='baidu_language_recognition')
|
25 |
|
|
|
32 |
|
33 |
count = 0
|
34 |
|
35 |
+
model_id2 = "riffusion/riffusion-model-v1"
|
36 |
+
pipe2 = StableDiffusionPipeline.from_pretrained(model_id2, torch_dtype=torch.float16)
|
37 |
+
pipe2 = pipe2.to("cuda")
|
38 |
+
|
39 |
+
|
40 |
def translate_language_example(text_prompts, style_indx):
|
41 |
return translate_language(text_prompts)
|
42 |
|