Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -643,7 +643,7 @@ def answer_question_thread(user_question, chatbot,audio=None):
|
|
| 643 |
while iterations < max_iterations:
|
| 644 |
|
| 645 |
response = agent_executor.invoke({"input": user_question}, config={"callbacks": [langfuse_handler]}, early_stopping_method="generate")
|
| 646 |
-
|
| 647 |
if isinstance(response, dict):
|
| 648 |
response_text = response.get("output", "")
|
| 649 |
else:
|
|
@@ -1246,6 +1246,20 @@ def handle_large_dataset(df, create_document,isDataFrame):
|
|
| 1246 |
|
| 1247 |
else:
|
| 1248 |
return "Your query returns a large dataset which is not supported in the current version. Please try a different query."
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1249 |
|
| 1250 |
def create_pdf(cname,ename,account_number):
|
| 1251 |
|
|
|
|
| 643 |
while iterations < max_iterations:
|
| 644 |
|
| 645 |
response = agent_executor.invoke({"input": user_question}, config={"callbacks": [langfuse_handler]}, early_stopping_method="generate")
|
| 646 |
+
create_file_HF()
|
| 647 |
if isinstance(response, dict):
|
| 648 |
response_text = response.get("output", "")
|
| 649 |
else:
|
|
|
|
| 1246 |
|
| 1247 |
else:
|
| 1248 |
return "Your query returns a large dataset which is not supported in the current version. Please try a different query."
|
| 1249 |
+
|
| 1250 |
+
def create_file_HF():
|
| 1251 |
+
from huggingface_hub import create_branch, create_tag
|
| 1252 |
+
from huggingface_hub import login
|
| 1253 |
+
|
| 1254 |
+
login(token=os.getenv("HF_TOKEN")
|
| 1255 |
+
#create_branch("Redmind/NewageNXTGPT_Repo_trial", repo_type="space", branch="test-branch")
|
| 1256 |
+
|
| 1257 |
+
#create_tag("bigcode/the-stack", repo_type="dataset", revision="v0.1-release", tag="v0.1.1", tag_message="Bump release version.")
|
| 1258 |
+
|
| 1259 |
+
from huggingface_hub import HfApi
|
| 1260 |
+
api = HfApi()
|
| 1261 |
+
api.upload_file(path_or_fileobj="Inbound.pdf", repo_id="Redmind/NewageNXTGPT_Repo_trial",revision = "test-branch", repo_type= "space", path_in_repo="Inbound.pdf")
|
| 1262 |
+
|
| 1263 |
|
| 1264 |
def create_pdf(cname,ename,account_number):
|
| 1265 |
|