File size: 1,089 Bytes
dcabc2d
 
 
 
 
81e510e
dcabc2d
 
 
 
 
4cbe1cd
 
 
81e510e
4cbe1cd
dcabc2d
 
 
 
 
 
 
81e510e
dcabc2d
 
 
4cbe1cd
81e510e
4cbe1cd
 
 
81e510e
 
 
 
 
4cbe1cd
500ab0b
81e510e
500ab0b
81e510e
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/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)