Spaces:
Sleeping
Sleeping
| #!/usr/bin/env python | |
| import os | |
| import re | |
| import tempfile | |
| import gc # garbage collector ์ถ๊ฐ | |
| from collections.abc import Iterator | |
| from threading import Thread | |
| import json | |
| import requests | |
| import cv2 | |
| import base64 | |
| import logging | |
| import time | |
| from urllib.parse import quote # URL ์ธ์ฝ๋ฉ์ ์ํด ์ถ๊ฐ | |
| import gradio as gr | |
| import spaces | |
| import torch | |
| from loguru import logger | |
| from PIL import Image | |
| from transformers import AutoProcessor, Gemma3ForConditionalGeneration, TextIteratorStreamer | |
| # CSV/TXT/PDF ๋ถ์ | |
| import pandas as pd | |
| import PyPDF2 | |
| # ============================================================================= | |
| # (์ ๊ท) ์ด๋ฏธ์ง API ๊ด๋ จ ํจ์๋ค | |
| # ============================================================================= | |
| from gradio_client import Client | |
| 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) |