Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -100,6 +100,11 @@ DB_PASSWORD = 'redmindGpt@123'
|
|
100 |
DB_HOST = '217.21.88.10'
|
101 |
DB_NAME = 'u852023448_redmindgpt'
|
102 |
|
|
|
|
|
|
|
|
|
|
|
103 |
|
104 |
langfuse_handler = CallbackHandler()
|
105 |
langfuse_handler.auth_check() # Optional: Checks if the authentication is successful
|
@@ -1220,9 +1225,7 @@ def handle_large_dataset(df, create_document,isDataFrame):
|
|
1220 |
return "Your query returns a large dataset which is not supported in the current version. Please try a different query."
|
1221 |
|
1222 |
def create_file_HF(file_path,directory):
|
1223 |
-
|
1224 |
-
from huggingface_hub import login
|
1225 |
-
from huggingface_hub import HfApi
|
1226 |
api = HfApi()
|
1227 |
|
1228 |
repo_id = "Redmind/NewageNXTGPT_Repo_trial"
|
@@ -1230,7 +1233,7 @@ def create_file_HF(file_path,directory):
|
|
1230 |
|
1231 |
|
1232 |
|
1233 |
-
|
1234 |
#check if direcotry exists
|
1235 |
dir_exists_flag = directory_exists(repo_id, directory, token)
|
1236 |
if not dir_exists_flag:
|
@@ -1238,7 +1241,7 @@ def create_file_HF(file_path,directory):
|
|
1238 |
else:
|
1239 |
directory = directory + "/" + file_path
|
1240 |
#if directory does not exist, create the directoty
|
1241 |
-
|
1242 |
#create_branch("Redmind/NewageNXTGPT_Repo_trial", repo_type="space", branch="test-branch")
|
1243 |
|
1244 |
#create_tag("bigcode/the-stack", repo_type="dataset", revision="v0.1-release", tag="v0.1.1", tag_message="Bump release version.")
|
|
|
100 |
DB_HOST = '217.21.88.10'
|
101 |
DB_NAME = 'u852023448_redmindgpt'
|
102 |
|
103 |
+
from huggingface_hub import create_branch, create_tag
|
104 |
+
from huggingface_hub import login
|
105 |
+
from huggingface_hub import HfApi
|
106 |
+
token = os.getenv("HF_TOKEN")
|
107 |
+
login(token=os.getenv("HF_TOKEN"))
|
108 |
|
109 |
langfuse_handler = CallbackHandler()
|
110 |
langfuse_handler.auth_check() # Optional: Checks if the authentication is successful
|
|
|
1225 |
return "Your query returns a large dataset which is not supported in the current version. Please try a different query."
|
1226 |
|
1227 |
def create_file_HF(file_path,directory):
|
1228 |
+
|
|
|
|
|
1229 |
api = HfApi()
|
1230 |
|
1231 |
repo_id = "Redmind/NewageNXTGPT_Repo_trial"
|
|
|
1233 |
|
1234 |
|
1235 |
|
1236 |
+
|
1237 |
#check if direcotry exists
|
1238 |
dir_exists_flag = directory_exists(repo_id, directory, token)
|
1239 |
if not dir_exists_flag:
|
|
|
1241 |
else:
|
1242 |
directory = directory + "/" + file_path
|
1243 |
#if directory does not exist, create the directoty
|
1244 |
+
|
1245 |
#create_branch("Redmind/NewageNXTGPT_Repo_trial", repo_type="space", branch="test-branch")
|
1246 |
|
1247 |
#create_tag("bigcode/the-stack", repo_type="dataset", revision="v0.1-release", tag="v0.1.1", tag_message="Bump release version.")
|