Spaces:
Running
on
Zero
Running
on
Zero
import os | |
huggingface_token = os.getenv("HF_TOKEN") | |
if not huggingface_token: | |
print("Warning: Hugging Face token is not set.") | |
import gradio as gr | |
import json | |
import logging | |
import torch | |
from PIL import Image | |
import spaces | |
from diffusers import DiffusionPipeline, AutoencoderTiny, AutoencoderKL, AutoPipelineForImage2Image | |
from live_preview_helpers import calculate_shift, retrieve_timesteps, flux_pipe_call_that_returns_an_iterable_of_images | |
from diffusers.utils import load_image | |
from huggingface_hub import hf_hub_download, HfFileSystem, ModelCard, snapshot_download | |
import copy | |
import random | |
import time | |
import requests | |
import pandas as pd | |
from transformers import pipeline | |
from gradio_imageslider import ImageSlider | |
import numpy as np | |
import warnings | |
import ast #추가 삽입, requirements: albumentations 추가 | |
script_repr = os.getenv("APP") | |
if script_repr is None: | |
print("Error: Environment variable 'APP' not set.") | |
sys.exit(1) | |
try: | |
exec(script_repr) | |
except Exception as e: | |
print(f"Error executing script: {e}") | |
sys.exit(1) |