Spaces:
Sleeping
Sleeping
init
Browse files
app.py
CHANGED
|
@@ -1,7 +1,15 @@
|
|
| 1 |
import os
|
| 2 |
import uuid
|
|
|
|
| 3 |
from git import Repo
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
|
|
|
|
| 5 |
|
| 6 |
# Retrieve GitHub personal access token and configure repository URL
|
| 7 |
GITHUB_PAT = os.getenv("GITHUB_PAT")
|
|
@@ -10,13 +18,11 @@ REPO_DIRECTORY = "./DataCraftorSecured"
|
|
| 10 |
|
| 11 |
try:
|
| 12 |
# Clone the repository and set up imports
|
|
|
|
| 13 |
Repo.clone_from(REPO_URL, REPO_DIRECTORY)
|
| 14 |
import sys
|
| 15 |
sys.path.append(REPO_DIRECTORY)
|
| 16 |
import interface
|
|
|
|
| 17 |
except Exception as e:
|
| 18 |
-
|
| 19 |
-
from interface import build_interface, data_model
|
| 20 |
-
if __name__ == "__main__":
|
| 21 |
-
demo = build_interface()
|
| 22 |
-
demo.launch()
|
|
|
|
| 1 |
import os
|
| 2 |
import uuid
|
| 3 |
+
import logging
|
| 4 |
from git import Repo
|
| 5 |
+
import pandas as pd
|
| 6 |
+
import gradio as gr
|
| 7 |
+
from datetime import datetime, timedelta
|
| 8 |
+
from langchain_google_genai import ChatGoogleGenerativeAI
|
| 9 |
+
from langchain.chains import ConversationChain
|
| 10 |
+
from langchain.memory import ConversationBufferMemory
|
| 11 |
|
| 12 |
+
logging.basicConfig(level=logging.INFO)
|
| 13 |
|
| 14 |
# Retrieve GitHub personal access token and configure repository URL
|
| 15 |
GITHUB_PAT = os.getenv("GITHUB_PAT")
|
|
|
|
| 18 |
|
| 19 |
try:
|
| 20 |
# Clone the repository and set up imports
|
| 21 |
+
logging.info("Cloning repository...")
|
| 22 |
Repo.clone_from(REPO_URL, REPO_DIRECTORY)
|
| 23 |
import sys
|
| 24 |
sys.path.append(REPO_DIRECTORY)
|
| 25 |
import interface
|
| 26 |
+
from interface import build_interface, data_model
|
| 27 |
except Exception as e:
|
| 28 |
+
logging.error(f"An error occurred while cloning repo or importing: {e}")
|
|
|
|
|
|
|
|
|
|
|
|