Spaces:
Runtime error
Runtime error
env var name change
Browse files
upload.py
CHANGED
@@ -8,7 +8,7 @@ s3 = boto3.client(
|
|
8 |
aws_secret_access_key=st.secrets["AWS_SECRET_KEY"]
|
9 |
)
|
10 |
|
11 |
-
def upload_file(data, bucket=st.secrets["
|
12 |
file_name = uuid.uuid4().hex
|
13 |
try:
|
14 |
key = f"{file_name}.pkl"
|
@@ -18,7 +18,7 @@ def upload_file(data, bucket=st.secrets["s3_bucket"]):
|
|
18 |
return file_name
|
19 |
|
20 |
|
21 |
-
def get_file(file_name, bucket=st.secrets["
|
22 |
try:
|
23 |
response = s3.get_object(Bucket=bucket, Key=f"{file_name}.pkl")
|
24 |
return response['Body'].read()
|
|
|
8 |
aws_secret_access_key=st.secrets["AWS_SECRET_KEY"]
|
9 |
)
|
10 |
|
11 |
+
def upload_file(data, bucket=st.secrets["S3_BUCKET"]):
|
12 |
file_name = uuid.uuid4().hex
|
13 |
try:
|
14 |
key = f"{file_name}.pkl"
|
|
|
18 |
return file_name
|
19 |
|
20 |
|
21 |
+
def get_file(file_name, bucket=st.secrets["S3_BUCKET"]):
|
22 |
try:
|
23 |
response = s3.get_object(Bucket=bucket, Key=f"{file_name}.pkl")
|
24 |
return response['Body'].read()
|