Spaces:
Runtime error
Runtime error
remove print datetime
#13
by
akhaliq
HF staff
- opened
app.py
CHANGED
@@ -1,7 +1,6 @@
|
|
1 |
import numpy as np
|
2 |
import gradio as gr
|
3 |
import paddlehub as hub
|
4 |
-
import datetime
|
5 |
|
6 |
|
7 |
model = hub.Module(name='ernie_vilg')
|
@@ -38,16 +37,13 @@ def translate_language(text_prompts):
|
|
38 |
|
39 |
|
40 |
def inference(text_prompts, style_indx):
|
41 |
-
print(datetime.datetime.now())
|
42 |
try:
|
43 |
style = style_list[style_indx]
|
44 |
results = model.generate_image(
|
45 |
text_prompts=text_prompts, style=style, visualization=False)
|
46 |
except Exception as e:
|
47 |
error_text = str(e)
|
48 |
-
print(datetime.datetime.now())
|
49 |
return {status_text:error_text, gallery:None}
|
50 |
-
print(datetime.datetime.now())
|
51 |
return {status_text:'Success', gallery:results[:6]}
|
52 |
|
53 |
|
|
|
1 |
import numpy as np
|
2 |
import gradio as gr
|
3 |
import paddlehub as hub
|
|
|
4 |
|
5 |
|
6 |
model = hub.Module(name='ernie_vilg')
|
|
|
37 |
|
38 |
|
39 |
def inference(text_prompts, style_indx):
|
|
|
40 |
try:
|
41 |
style = style_list[style_indx]
|
42 |
results = model.generate_image(
|
43 |
text_prompts=text_prompts, style=style, visualization=False)
|
44 |
except Exception as e:
|
45 |
error_text = str(e)
|
|
|
46 |
return {status_text:error_text, gallery:None}
|
|
|
47 |
return {status_text:'Success', gallery:results[:6]}
|
48 |
|
49 |
|