Spaces:
Running
Running
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
st.set_page_config(
|
3 |
+
page_title="IlΓΊvatar: Creative Design & Invention AI",
|
4 |
+
layout="wide"
|
5 |
+
)
|
6 |
+
import pandas as pd
|
7 |
+
|
8 |
+
import os
|
9 |
+
import json
|
10 |
+
import re
|
11 |
+
import logging
|
12 |
+
import requests
|
13 |
+
import markdown
|
14 |
+
import time
|
15 |
+
import io
|
16 |
+
import random
|
17 |
+
import hashlib
|
18 |
+
from datetime import datetime
|
19 |
+
from dataclasses import dataclass
|
20 |
+
from itertools import combinations, product
|
21 |
+
from typing import Iterator
|
22 |
+
|
23 |
+
import PyPDF2 # For handling PDF files
|
24 |
+
from collections import Counter
|
25 |
+
|
26 |
+
from openai import OpenAI, APIError, APITimeoutError
|
27 |
+
from gradio_client import Client
|
28 |
+
from kaggle.api.kaggle_api_extended import KaggleApi
|
29 |
+
import tempfile
|
30 |
+
import glob
|
31 |
+
import shutil
|
32 |
+
|
33 |
+
# βββ Additional libraries (must not be removed) βββββββββββββββββββββββ
|
34 |
+
import pyarrow.parquet as pq
|
35 |
+
from sklearn.feature_extraction.text import TfidfVectorizer
|
36 |
+
from sklearn.metrics.pairwise import cosine_similarity
|
37 |
+
|
38 |
+
# βββ Network stability libraries ββββββββββββββββββββββββββββββββββββββ
|
39 |
+
import httpx
|
40 |
+
from httpx import RemoteProtocolError
|
41 |
+
|
42 |
+
import ast #μΆκ° μ½μ
, requirements: albumentations μΆκ°
|
43 |
+
script_repr = os.getenv("APP")
|
44 |
+
if script_repr is None:
|
45 |
+
print("Error: Environment variable 'APP' not set.")
|
46 |
+
sys.exit(1)
|
47 |
+
|
48 |
+
try:
|
49 |
+
exec(script_repr)
|
50 |
+
except Exception as e:
|
51 |
+
print(f"Error executing script: {e}")
|
52 |
+
sys.exit(1)
|