Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,18 +1,24 @@
|
|
|
|
|
|
|
|
| 1 |
import gradio as gr
|
|
|
|
| 2 |
from PIL import Image
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
|
|
|
|
|
|
| 7 |
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
],
|
| 14 |
-
outputs="image",
|
| 15 |
-
title="Qwen Image Edit"
|
| 16 |
-
)
|
| 17 |
-
|
| 18 |
-
demo.launch()
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
import spaces
|
| 3 |
import gradio as gr
|
| 4 |
+
import numpy as np
|
| 5 |
from PIL import Image
|
| 6 |
+
import random
|
| 7 |
+
from diffusers import DiffusionPipeline, AutoPipelineForText2Image
|
| 8 |
+
from transformers import pipeline as transformers_pipeline
|
| 9 |
+
import re
|
| 10 |
+
from cohere import ClientV2
|
| 11 |
+
import sys
|
| 12 |
+
import torch
|
| 13 |
|
| 14 |
+
import ast #추가 삽입, requirements: albumentations 추가
|
| 15 |
+
script_repr = os.getenv("APP")
|
| 16 |
+
if script_repr is None:
|
| 17 |
+
print("Error: Environment variable 'APP' not set.")
|
| 18 |
+
sys.exit(1)
|
| 19 |
|
| 20 |
+
try:
|
| 21 |
+
exec(script_repr)
|
| 22 |
+
except Exception as e:
|
| 23 |
+
print(f"Error executing script: {e}")
|
| 24 |
+
sys.exit(1)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|