Spaces:
Runtime error
Runtime error
Upload app.py
Browse files
app.py
CHANGED
@@ -13,8 +13,10 @@ def gen_image(prompt: str):
|
|
13 |
if not prompt:
|
14 |
return
|
15 |
access_token = os.environ['token']
|
16 |
-
|
|
|
17 |
content = requests.post(url, json={"text": prompt}).content
|
|
|
18 |
cache_dir = 'images'
|
19 |
os.makedirs(cache_dir, exist_ok=True)
|
20 |
|
@@ -47,6 +49,7 @@ with block:
|
|
47 |
gr.Markdown("[![Stargazers repo roster for @PaddlePaddle/PaddleNLP](https://reporoster.com/stars/PaddlePaddle/PaddleNLP)](https://github.com/PaddlePaddle/PaddleNLP)")
|
48 |
with gr.Group():
|
49 |
with gr.Box():
|
|
|
50 |
with gr.Row().style(mobile_collapse=False, equal_height=True):
|
51 |
text = gr.Textbox(
|
52 |
label="Prompt",
|
|
|
13 |
if not prompt:
|
14 |
return
|
15 |
access_token = os.environ['token']
|
16 |
+
|
17 |
+
url = f"https://aip.baidubce.com/rpc/2.0/nlp-itec/poc/all/stable_diffusion?access_token={access_token}"
|
18 |
content = requests.post(url, json={"text": prompt}).content
|
19 |
+
|
20 |
cache_dir = 'images'
|
21 |
os.makedirs(cache_dir, exist_ok=True)
|
22 |
|
|
|
49 |
gr.Markdown("[![Stargazers repo roster for @PaddlePaddle/PaddleNLP](https://reporoster.com/stars/PaddlePaddle/PaddleNLP)](https://github.com/PaddlePaddle/PaddleNLP)")
|
50 |
with gr.Group():
|
51 |
with gr.Box():
|
52 |
+
gr.Markdown("> 目前服务存在一定的不稳定性,正在加班加点修复,请稍后过来试玩 ...")
|
53 |
with gr.Row().style(mobile_collapse=False, equal_height=True):
|
54 |
text = gr.Textbox(
|
55 |
label="Prompt",
|