Spaces:
Runtime error
Runtime error
Wintersmith
commited on
Commit
•
a6b5d9e
1
Parent(s):
4871c78
Upload 3 files
Browse files
app.py
CHANGED
@@ -3,15 +3,18 @@ import pandas as pd
|
|
3 |
import boto3
|
4 |
import dotenv
|
5 |
import os
|
|
|
6 |
|
7 |
from recommender_system import match_books, recommend_books
|
8 |
|
9 |
dotenv.load_dotenv()
|
|
|
10 |
|
11 |
# Initialize S3 client and load data
|
12 |
s3 = boto3.client('s3',
|
13 |
aws_access_key_id=os.getenv('AWS_ACCESS_KEY_ID'),
|
14 |
-
aws_secret_access_key=os.getenv('AWS_SECRET_ACCESS_KEY')
|
|
|
15 |
bucket_name = 'martinbucket1'
|
16 |
obj_data = s3.get_object(Bucket=bucket_name, Key="Processed_data.csv")
|
17 |
dataframe = pd.read_csv(obj_data["Body"], encoding='cp1251', sep=',', low_memory=False)
|
|
|
3 |
import boto3
|
4 |
import dotenv
|
5 |
import os
|
6 |
+
import logging
|
7 |
|
8 |
from recommender_system import match_books, recommend_books
|
9 |
|
10 |
dotenv.load_dotenv()
|
11 |
+
boto3.set_stream_logger('boto3.resources', logging.DEBUG)
|
12 |
|
13 |
# Initialize S3 client and load data
|
14 |
s3 = boto3.client('s3',
|
15 |
aws_access_key_id=os.getenv('AWS_ACCESS_KEY_ID'),
|
16 |
+
aws_secret_access_key=os.getenv('AWS_SECRET_ACCESS_KEY'),
|
17 |
+
region_name=os.getenv('AWS_REGION'))
|
18 |
bucket_name = 'martinbucket1'
|
19 |
obj_data = s3.get_object(Bucket=bucket_name, Key="Processed_data.csv")
|
20 |
dataframe = pd.read_csv(obj_data["Body"], encoding='cp1251', sep=',', low_memory=False)
|