Dhruv Diddi commited on
Commit
a8c30fe
β€’
1 Parent(s): fc97eea

whisper test

Browse files
Files changed (2) hide show
  1. app.py +456 -77
  2. requirements.txt +5 -12
app.py CHANGED
@@ -1,89 +1,468 @@
1
  import gradio as gr
2
- import torch
3
- from torch import autocast
4
- from diffusers import StableDiffusionPipeline
5
- from datasets import load_dataset
6
- from PIL import Image
7
- import re
8
  import os
 
9
 
10
- from libretranslatepy import LibreTranslateAPI
11
- lt = LibreTranslateAPI("https://translate.argosopentech.com/")
12
 
13
- auth_token = os.getenv("auth_token")
14
- model_id = "CompVis/stable-diffusion-v1-4"
15
- device = "cpu"
16
- pipe = StableDiffusionPipeline.from_pretrained(model_id, use_auth_token=auth_token)
17
- pipe = pipe.to(device)
18
 
19
- def infer(prompt, samples, steps, scale, seed):
20
- lang_detected = lt.detect(prompt)[0]['language']
21
- print(lang_detected)
22
- translated = lt.translate(prompt, lang_detected, "en")
23
- print(translated)
24
- generator = torch.Generator(device=device).manual_seed(seed)
25
- images_list = pipe(
26
- [translated] * samples,
27
- num_inference_steps=steps,
28
- guidance_scale=scale,
29
- generator=generator,
30
- )
31
- images = []
32
- safe_image = Image.open(r"unsafe.png")
33
- for i, image in enumerate(images_list["sample"]):
34
- if(images_list["nsfw_content_detected"][i]):
35
- images.append(safe_image)
36
- else:
37
- images.append(image)
38
- return images
39
-
40
 
 
41
 
42
- block = gr.Blocks()
 
43
 
44
- with block:
45
- with gr.Group():
46
- with gr.Box():
47
- with gr.Row().style(mobile_collapse=False, equal_height=True):
48
- text = gr.Textbox(
49
- label="Enter your prompt",
50
- show_label=False,
51
- max_lines=1,
52
- placeholder="Enter your prompt",
53
- ).style(
54
- border=(True, False, True, True),
55
- rounded=(True, False, False, True),
56
- container=False,
57
- )
58
- btn = gr.Button("Generate image").style(
59
- margin=False,
60
- rounded=(False, True, True, False),
61
- )
62
- gallery = gr.Gallery(
63
- label="Generated images", show_label=False, elem_id="gallery"
64
- ).style(grid=[2], height="auto")
65
 
66
- advanced_button = gr.Button("Advanced options", elem_id="advanced-btn")
 
 
67
 
68
- with gr.Row(elem_id="advanced-options"):
69
- samples = gr.Slider(label="Images", minimum=1, maximum=4, value=4, step=1)
70
- steps = gr.Slider(label="Steps", minimum=1, maximum=50, value=45, step=1)
71
- scale = gr.Slider(
72
- label="Guidance Scale", minimum=0, maximum=50, value=7.5, step=0.1
73
- )
74
- seed = gr.Slider(
75
- label="Seed",
76
- minimum=0,
77
- maximum=2147483647,
78
- step=1,
79
- randomize=True,
80
- )
81
- text.submit(infer, inputs=[text, samples, steps, scale, seed], outputs=gallery)
82
- btn.click(infer, inputs=[text, samples, steps, scale, seed], outputs=gallery)
83
- advanced_button.click(
84
- None,
85
- [],
86
- text,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
87
  )
88
 
89
- block.launch()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  import gradio as gr
2
+ #import torch
3
+ import whisper
4
+ from datetime import datetime
5
+ from PIL import Image
6
+ import flag
 
7
  import os
8
+ #MY_SECRET_TOKEN=os.environ.get('HF_TOKEN_SD')
9
 
10
+ #from diffusers import StableDiffusionPipeline
 
11
 
12
+ stable_diffusion = gr.Blocks.load(name="spaces/stabilityai/stable-diffusion")
13
+ ### β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”
 
 
 
14
 
15
+ title="Whisper to Stable Diffusion"
16
+
17
+ ### β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”
18
+
19
+ whisper_model = whisper.load_model("small")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
 
21
+ #device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
22
 
23
+ #pipe = StableDiffusionPipeline.from_pretrained("CompVis/stable-diffusion-v1-4", use_auth_token=MY_SECRET_TOKEN)
24
+ #pipe.to(device)
25
 
26
+ ### β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27
 
28
+ def get_images(prompt):
29
+ gallery_dir = stable_diffusion(prompt, fn_index=2)
30
+ return [os.path.join(gallery_dir, img) for img in os.listdir(gallery_dir)]
31
 
32
+
33
+ def magic_whisper_to_sd(audio, guidance_scale, nb_iterations, seed):
34
+
35
+ whisper_results = translate(audio)
36
+ prompt = whisper_results[2]
37
+ images = get_images(prompt)
38
+
39
+ return whisper_results[0], whisper_results[1], whisper_results[2], images
40
+
41
+ #def diffuse(prompt, guidance_scale, nb_iterations, seed):
42
+ #
43
+ # generator = torch.Generator(device=device).manual_seed(int(seed))
44
+ #
45
+ # print("""
46
+ # β€”
47
+ # Sending prompt to Stable Diffusion ...
48
+ # β€”
49
+ # """)
50
+ # print("prompt: " + prompt)
51
+ # print("guidance scale: " + str(guidance_scale))
52
+ # print("inference steps: " + str(nb_iterations))
53
+ # print("seed: " + str(seed))
54
+ #
55
+ # images_list = pipe(
56
+ # [prompt] * 2,
57
+ # guidance_scale=guidance_scale,
58
+ # num_inference_steps=nb_iterations,
59
+ # generator=generator
60
+ # )
61
+ #
62
+ # images = []
63
+ #
64
+ # safe_image = Image.open(r"unsafe.png")
65
+ #
66
+ # for i, image in enumerate(images_list["sample"]):
67
+ # if(images_list["nsfw_content_detected"][i]):
68
+ # images.append(safe_image)
69
+ # else:
70
+ # images.append(image)
71
+ #
72
+ #
73
+ # print("Stable Diffusion has finished")
74
+ # print("β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”")
75
+ #
76
+ # return images
77
+
78
+ def translate(audio):
79
+ print("""
80
+ β€”
81
+ Sending audio to Whisper ...
82
+ β€”
83
+ """)
84
+ # current dateTime
85
+ now = datetime.now()
86
+ # convert to string
87
+ date_time_str = now.strftime("%Y-%m-%d %H:%M:%S")
88
+ print('DateTime String:', date_time_str)
89
+
90
+ audio = whisper.load_audio(audio)
91
+ audio = whisper.pad_or_trim(audio)
92
+
93
+ mel = whisper.log_mel_spectrogram(audio).to(whisper_model.device)
94
+
95
+ _, probs = whisper_model.detect_language(mel)
96
+
97
+ transcript_options = whisper.DecodingOptions(task="transcribe", fp16 = False)
98
+ translate_options = whisper.DecodingOptions(task="translate", fp16 = False)
99
+
100
+ transcription = whisper.decode(whisper_model, mel, transcript_options)
101
+ translation = whisper.decode(whisper_model, mel, translate_options)
102
+
103
+ print("language spoken: " + transcription.language)
104
+ print("transcript: " + transcription.text)
105
+ print("β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”")
106
+ print("translated: " + translation.text)
107
+ if transcription.language == "en":
108
+ tr_flag = flag.flag('GB')
109
+ else:
110
+ tr_flag = flag.flag(transcription.language)
111
+ return tr_flag, transcription.text, translation.text
112
+
113
+ ### β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”
114
+
115
+ css = """
116
+ .container {
117
+ max-width: 880px;
118
+ margin: auto;
119
+ padding-top: 1.5rem;
120
+ }
121
+ a {
122
+ text-decoration: underline;
123
+ }
124
+ h1 {
125
+ font-weight: 900;
126
+ margin-bottom: 7px;
127
+ text-align: center;
128
+ font-size: 2em;
129
+ margin-bottom: 1em;
130
+ }
131
+ #w2sd_container{
132
+ margin-top: 20px;
133
+ }
134
+ .footer {
135
+ margin-bottom: 45px;
136
+ margin-top: 35px;
137
+ text-align: center;
138
+ border-bottom: 1px solid #e5e5e5;
139
+ }
140
+ .footer>p {
141
+ font-size: .8rem;
142
+ display: inline-block;
143
+ padding: 0 10px;
144
+ transform: translateY(10px);
145
+ background: white;
146
+ }
147
+ .dark .footer {
148
+ border-color: #303030;
149
+ }
150
+ .dark .footer>p {
151
+ background: #0b0f19;
152
+ }
153
+ .tabitem {
154
+ border-bottom-left-radius: 10px;
155
+ border-bottom-right-radius: 10px;
156
+ }
157
+ #record_tab, #upload_tab {
158
+ font-size: 1.2em;
159
+ }
160
+ #record_btn{
161
+
162
+ }
163
+ #record_btn > div > button > span {
164
+ width: 2.375rem;
165
+ height: 2.375rem;
166
+ }
167
+ #record_btn > div > button > span > span {
168
+ width: 2.375rem;
169
+ height: 2.375rem;
170
+ }
171
+ audio {
172
+ margin-bottom: 10px;
173
+ }
174
+ div#record_btn > .mt-6{
175
+ margin-top: 0!important;
176
+ }
177
+ div#record_btn > .mt-6 button {
178
+ font-size: 2em;
179
+ width: 100%;
180
+ padding: 20px;
181
+ height: 160px;
182
+ }
183
+ div#upload_area {
184
+ height: 11.1rem;
185
+ }
186
+ div#upload_area > div.w-full > div {
187
+ min-height: 9rem;
188
+ }
189
+ #check_btn_1, #check_btn_2{
190
+ color: #fff;
191
+ --tw-gradient-from: #4caf50;
192
+ --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
193
+ --tw-gradient-to: #4caf50;
194
+ border-color: #8bc34a;
195
+ }
196
+ #magic_btn_1, #magic_btn_2{
197
+ color: #fff;
198
+ --tw-gradient-from: #f44336;
199
+ --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
200
+ --tw-gradient-to: #ff9800;
201
+ border-color: #ff9800;
202
+ }
203
+ input::-webkit-inner-spin-button, input::-webkit-outer-spin-button {
204
+ -webkit-appearance: none;
205
+ }
206
+ input[type=number] {
207
+ -moz-appearance: textfield;
208
+ }
209
+ input[type=range] {
210
+ -webkit-appearance: none;
211
+ cursor: pointer;
212
+ height: 1px;
213
+ background: currentColor;
214
+ }
215
+ input[type=range]::-webkit-slider-thumb {
216
+ -webkit-appearance: none;
217
+ width: 0.5em;
218
+ height: 1.2em;
219
+ border-radius: 10px;
220
+ background: currentColor;
221
+ }
222
+ input[type=range]::-moz-range-thumb{
223
+ width: 0.5em;
224
+ height: 1.2em;
225
+ border-radius: 10px;
226
+ background: currentColor;
227
+ }
228
+ div#spoken_lang textarea {
229
+ font-size: 4em;
230
+ line-height: 1em;
231
+ text-align: center;
232
+ }
233
+ div#transcripted {
234
+ flex: 4;
235
+ }
236
+ div#translated textarea {
237
+ font-size: 1.5em;
238
+ line-height: 1.25em;
239
+ }
240
+ #sd_settings {
241
+ margin-bottom: 20px;
242
+ }
243
+ #diffuse_btn {
244
+ color: #fff;
245
+ font-size: 1em;
246
+ margin-bottom: 20px;
247
+ --tw-gradient-from: #4caf50;
248
+ --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
249
+ --tw-gradient-to: #4caf50;
250
+ border-color: #8bc34a;
251
+ }
252
+ #notice {
253
+ padding: 20px 14px 10px;
254
+ display: flex;
255
+ align-content: space-evenly;
256
+ gap: 20px;
257
+ line-height: 1em;
258
+ font-size: .8em;
259
+ border: 1px solid #374151;
260
+ border-radius: 10px;
261
+ }
262
+ #about {
263
+ padding: 20px;
264
+ }
265
+ #notice > div {
266
+ flex: 1;
267
+ }
268
+
269
+ """
270
+
271
+ ### β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”
272
+
273
+ with gr.Blocks(css=css) as demo:
274
+ with gr.Column():
275
+ gr.HTML('''
276
+ <h1>
277
+ Whisper to Stable Diffusion
278
+ </h1>
279
+ <p style='text-align: center;'>
280
+ Ask stable diffusion for images by speaking (or singing πŸ€—) in your native language ! Try it in French πŸ˜‰
281
+ </p>
282
+
283
+ <p style='text-align: center;'>
284
+ This demo is wired to the official SD Space β€’ Offered by Sylvain <a href='https://twitter.com/fffiloni' target='_blank'>@fffiloni</a> β€’ <img id='visitor-badge' alt='visitor badge' src='https://visitor-badge.glitch.me/badge?page_id=gradio-blocks.whisper-to-stable-diffusion' style='display: inline-block' /><br />
285
+ β€”
286
+ </p>
287
+
288
+ ''')
289
+ # with gr.Row(elem_id="w2sd_container"):
290
+ # with gr.Column():
291
+
292
+ gr.Markdown(
293
+ """
294
+
295
+ ## 1. Record audio or Upload an audio file:
296
+ """
297
+ )
298
+
299
+ with gr.Tab(label="Record audio input", elem_id="record_tab"):
300
+ with gr.Column():
301
+ record_input = gr.Audio(
302
+ source="microphone",
303
+ type="filepath",
304
+ show_label=False,
305
+ elem_id="record_btn"
306
+ )
307
+ with gr.Row():
308
+ audio_r_translate = gr.Button("Check Whisper first ? πŸ‘", elem_id="check_btn_1")
309
+ audio_r_direct_sd = gr.Button("Magic Whisper β€Ί SD right now!", elem_id="magic_btn_1")
310
+
311
+ with gr.Tab(label="Upload audio input", elem_id="upload_tab"):
312
+ with gr.Column():
313
+ upload_input = gr.Audio(
314
+ source="upload",
315
+ type="filepath",
316
+ show_label=False,
317
+ elem_id="upload_area"
318
+ )
319
+ with gr.Row():
320
+ audio_u_translate = gr.Button("Check Whisper first ? πŸ‘", elem_id="check_btn_2")
321
+ audio_u_direct_sd = gr.Button("Magic Whisper β€Ί SD right now!", elem_id="magic_btn_2")
322
+
323
+ with gr.Accordion(label="Stable Diffusion Settings", elem_id="sd_settings", visible=False):
324
+ with gr.Row():
325
+ guidance_scale = gr.Slider(2, 15, value = 7, label = 'Guidance Scale')
326
+ nb_iterations = gr.Slider(10, 50, value = 25, step = 1, label = 'Steps')
327
+ seed = gr.Slider(label = "Seed", minimum = 0, maximum = 2147483647, step = 1, randomize = True)
328
+
329
+ gr.Markdown(
330
+ """
331
+ ## 2. Check Whisper output, correct it if necessary:
332
+ """
333
  )
334
 
335
+ with gr.Row():
336
+
337
+ transcripted_output = gr.Textbox(
338
+ label="Transcription in your detected spoken language",
339
+ lines=3,
340
+ elem_id="transcripted"
341
+ )
342
+ language_detected_output = gr.Textbox(label="Native language", elem_id="spoken_lang",lines=3)
343
+
344
+ with gr.Column():
345
+ translated_output = gr.Textbox(
346
+ label="Transcript translated in English by Whisper",
347
+ lines=4,
348
+ elem_id="translated"
349
+ )
350
+ with gr.Row():
351
+ clear_btn = gr.Button(value="Clear")
352
+ diffuse_btn = gr.Button(value="OK, Diffuse this prompt !", elem_id="diffuse_btn")
353
+
354
+ clear_btn.click(fn=lambda value: gr.update(value=""), inputs=clear_btn, outputs=translated_output)
355
+
356
+
357
+
358
+
359
+
360
+ # with gr.Column():
361
+
362
+
363
+
364
+ gr.Markdown("""
365
+ ## 3. Wait for Stable Diffusion Results β˜•οΈ
366
+ Inference time is about ~20-30 seconds, when it's your turn 😬
367
+ """
368
+ )
369
+
370
+ sd_output = gr.Gallery().style(grid=2, height="auto")
371
+
372
+
373
+ gr.Markdown("""
374
+ ### πŸ“Œ About the models
375
+ <p style='font-size: 1em;line-height: 1.5em;'>
376
+ <strong>Whisper</strong> is a general-purpose speech recognition model.<br /><br />
377
+ It is trained on a large dataset of diverse audio and is also a multi-task model that can perform multilingual speech recognition as well as speech translation and language identification. <br />
378
+ β€”
379
+ </p>
380
+ <p style='font-size: 1em;line-height: 1.5em;'>
381
+ <strong>Stable Diffusion</strong> is a state of the art text-to-image model that generates images from text.
382
+ </p>
383
+ <div id="notice">
384
+ <div>
385
+ LICENSE
386
+ <p style='font-size: 0.8em;'>
387
+ The model is licensed with a <a href="https://huggingface.co/spaces/CompVis/stable-diffusion-license" target="_blank">CreativeML Open RAIL-M</a> license.</p>
388
+ <p style='font-size: 0.8em;'>
389
+ The authors claim no rights on the outputs you generate, you are free to use them and are accountable for their use which must not go against the provisions set in this license.</p>
390
+ <p style='font-size: 0.8em;'>
391
+ The license forbids you from sharing any content that violates any laws, produce any harm to a person, disseminate any personal information that would be meant for harm, spread misinformation and target vulnerable groups.</p>
392
+ <p style='font-size: 0.8em;'>
393
+ For the full list of restrictions please <a href="https://huggingface.co/spaces/CompVis/stable-diffusion-license" target="_blank" target="_blank">read the license</a>.
394
+ </p>
395
+ </div>
396
+ <div>
397
+ Biases and content acknowledgment
398
+ <p style='font-size: 0.8em;'>
399
+ Despite how impressive being able to turn text into image is, beware to the fact that this model may output content that reinforces or exacerbates societal biases, as well as realistic faces, pornography and violence.</p>
400
+ <p style='font-size: 0.8em;'>
401
+ The model was trained on the <a href="https://laion.ai/blog/laion-5b/" target="_blank">LAION-5B dataset</a>, which scraped non-curated image-text-pairs from the internet (the exception being the removal of illegal content) and is meant for research purposes.</p>
402
+ <p style='font-size: 0.8em;'> You can read more in the <a href="https://huggingface.co/CompVis/stable-diffusion-v1-4" target="_blank">model card</a>.
403
+ </p>
404
+ </div>
405
+ </div>
406
+
407
+ """, elem_id="about")
408
+
409
+ audio_r_translate.click(translate,
410
+ inputs = record_input,
411
+ outputs = [
412
+ language_detected_output,
413
+ transcripted_output,
414
+ translated_output
415
+ ])
416
+
417
+ audio_u_translate.click(translate,
418
+ inputs = upload_input,
419
+ outputs = [
420
+ language_detected_output,
421
+ transcripted_output,
422
+ translated_output
423
+ ])
424
+
425
+ audio_r_direct_sd.click(magic_whisper_to_sd,
426
+ inputs = [
427
+ record_input,
428
+ guidance_scale,
429
+ nb_iterations,
430
+ seed
431
+ ],
432
+ outputs = [
433
+ language_detected_output,
434
+ transcripted_output,
435
+ translated_output,
436
+ sd_output
437
+ ])
438
+
439
+ audio_u_direct_sd.click(magic_whisper_to_sd,
440
+ inputs = [
441
+ upload_input,
442
+ guidance_scale,
443
+ nb_iterations,
444
+ seed
445
+ ],
446
+ outputs = [
447
+ language_detected_output,
448
+ transcripted_output,
449
+ translated_output,
450
+ sd_output
451
+ ])
452
+
453
+ diffuse_btn.click(get_images,
454
+ inputs = [
455
+ translated_output
456
+ ],
457
+ outputs = sd_output
458
+ )
459
+ gr.HTML('''
460
+ <div class="footer">
461
+ <p>Whisper by <a href="https://github.com/openai/whisper" target="_blank">OpenAI</a> - Stable Diffusion by <a href="https://huggingface.co/CompVis" target="_blank">CompVis</a> and <a href="https://huggingface.co/stabilityai" target="_blank">Stability AI</a>
462
+ </p>
463
+ </div>
464
+ ''')
465
+
466
+
467
+ if __name__ == "__main__":
468
+ demo.launch()
requirements.txt CHANGED
@@ -1,14 +1,7 @@
1
- --extra-index-url https://download.pytorch.org/whl/cu113
2
- imageio==2.19.5
3
- imageio-ffmpeg==0.4.7
4
- numpy==1.22.4
5
- opencv-python-headless==4.6.0.66
6
- torch==1.12.0+cu113
7
- torchvision==0.13.0+cu113
8
- Pillow
9
  scipy
10
- scikit-image
11
- diffusers==0.3.0
12
- transformers
13
  ftfy
14
- libretranslatepy
 
 
 
 
1
+ #torch
 
 
 
 
 
 
 
2
  scipy
 
 
 
3
  ftfy
4
+ #transformers
5
+ emoji-country-flag
6
+ #git+https://github.com/LambdaLabsML/lambda-diffusers.git#egg=lambda-diffusers
7
+ git+https://github.com/openai/whisper.git