Spaces:
Runtime error
Runtime error
Commit
·
fa30f7e
1
Parent(s):
718bec8
Upload app.py
Browse files
app.py
CHANGED
@@ -51,20 +51,20 @@ DESCRIPTION = """
|
|
51 |
if not torch.cuda.is_available():
|
52 |
DESCRIPTION += '\n<p>Running on CPU 🥶 This demo does not work on CPU.</p>'
|
53 |
|
54 |
-
s3 = boto3.client(
|
55 |
-
"s3",
|
56 |
-
aws_access_key_id=os.environ["AWS_ACCESS_KEY_ID"],
|
57 |
-
aws_secret_access_key=os.environ["AWS_SECRET_ACCESS_KEY"],
|
58 |
-
region_name=os.environ["S3_REGION"],
|
59 |
-
config=Config(
|
60 |
-
connect_timeout=5,
|
61 |
-
read_timeout=5,
|
62 |
-
retries={
|
63 |
-
"mode": "standard",
|
64 |
-
"total_max_attempts": 3,
|
65 |
-
}
|
66 |
-
)
|
67 |
-
)
|
68 |
|
69 |
def clear_and_save_textbox(message: str) -> tuple[str, str]:
|
70 |
return '', message
|
@@ -190,15 +190,15 @@ def output_log(history: list[tuple[str, str]], uuid_list: list[tuple[str, str]])
|
|
190 |
"role": role,
|
191 |
"message": record_message,
|
192 |
}
|
193 |
-
try:
|
194 |
-
csv_buffer = pd.DataFrame(d, index=[0]).to_csv(index=None)
|
195 |
-
s3.put_object(
|
196 |
-
Bucket=os.environ["S3_BUCKET"],
|
197 |
-
Key=f"{os.environ['S3_KEY_PREFIX']}/{yyyymmdd}/{record_uuid}.csv",
|
198 |
-
Body=csv_buffer
|
199 |
-
)
|
200 |
-
except:
|
201 |
-
pass
|
202 |
return
|
203 |
|
204 |
|
|
|
51 |
if not torch.cuda.is_available():
|
52 |
DESCRIPTION += '\n<p>Running on CPU 🥶 This demo does not work on CPU.</p>'
|
53 |
|
54 |
+
#s3 = boto3.client(
|
55 |
+
# "s3",
|
56 |
+
# aws_access_key_id=os.environ["AWS_ACCESS_KEY_ID"],
|
57 |
+
# aws_secret_access_key=os.environ["AWS_SECRET_ACCESS_KEY"],
|
58 |
+
# region_name=os.environ["S3_REGION"],
|
59 |
+
# config=Config(
|
60 |
+
# connect_timeout=5,
|
61 |
+
# read_timeout=5,
|
62 |
+
# retries={
|
63 |
+
# "mode": "standard",
|
64 |
+
# "total_max_attempts": 3,
|
65 |
+
# }
|
66 |
+
# )
|
67 |
+
#)
|
68 |
|
69 |
def clear_and_save_textbox(message: str) -> tuple[str, str]:
|
70 |
return '', message
|
|
|
190 |
"role": role,
|
191 |
"message": record_message,
|
192 |
}
|
193 |
+
# try:
|
194 |
+
# csv_buffer = pd.DataFrame(d, index=[0]).to_csv(index=None)
|
195 |
+
# s3.put_object(
|
196 |
+
# Bucket=os.environ["S3_BUCKET"],
|
197 |
+
# Key=f"{os.environ['S3_KEY_PREFIX']}/{yyyymmdd}/{record_uuid}.csv",
|
198 |
+
# Body=csv_buffer
|
199 |
+
# )
|
200 |
+
# except:
|
201 |
+
# pass
|
202 |
return
|
203 |
|
204 |
|