Spaces:
Runtime error
Runtime error
StormblessedKal
commited on
Commit
•
d71b153
1
Parent(s):
ba4a908
s3 bucket
Browse files- src/predict.py +6 -4
src/predict.py
CHANGED
@@ -83,6 +83,8 @@ class Predictor:
|
|
83 |
self.s3_client = boto3.client('s3',aws_access_key_id=os.getenv('AWS_ACCESS_KEY'), aws_secret_access_key=os.getenv('AWS_SECRET_KEY'))
|
84 |
print(os.getenv("AWS_ACCESS_KEY"))
|
85 |
print(os.getenv("AWS_SECRET_KEY"))
|
|
|
|
|
86 |
|
87 |
|
88 |
def setup(self):
|
@@ -150,7 +152,7 @@ class Predictor:
|
|
150 |
header = file_buffer.read(12)
|
151 |
print(header)
|
152 |
file_format = None
|
153 |
-
bucket_name =
|
154 |
if b'WAVE' in header:
|
155 |
file_format = 'wav'
|
156 |
elif b'OggS' in header:
|
@@ -220,7 +222,7 @@ class Predictor:
|
|
220 |
|
221 |
|
222 |
s3_key = s3_url.split('/')[-1]
|
223 |
-
bucket_name =
|
224 |
local_file_path = os.path.join(raw_dir,s3_key)
|
225 |
self.download_file_from_s3(self.s3_client,bucket_name,s3_key,local_file_path)
|
226 |
#voice_clone with styletts2
|
@@ -275,7 +277,7 @@ class Predictor:
|
|
275 |
|
276 |
|
277 |
s3_key = s3_url.split('/')[-1]
|
278 |
-
bucket_name =
|
279 |
local_file_path = os.path.join(raw_dir,s3_key)
|
280 |
self.download_file_from_s3(self.s3_client,bucket_name,s3_key,local_file_path)
|
281 |
#voice_clone with styletts2
|
@@ -317,7 +319,7 @@ class Predictor:
|
|
317 |
|
318 |
|
319 |
s3_key = s3_url.split('/')[-1]
|
320 |
-
bucket_name =
|
321 |
local_file_path = os.path.join(raw_dir,s3_key)
|
322 |
self.download_file_from_s3(self.s3_client,bucket_name,s3_key,local_file_path)
|
323 |
model,sampler = self.model,self.sampler
|
|
|
83 |
self.s3_client = boto3.client('s3',aws_access_key_id=os.getenv('AWS_ACCESS_KEY'), aws_secret_access_key=os.getenv('AWS_SECRET_KEY'))
|
84 |
print(os.getenv("AWS_ACCESS_KEY"))
|
85 |
print(os.getenv("AWS_SECRET_KEY"))
|
86 |
+
self.bucket_name = os.getenv('S3_BUCKET_NAME')
|
87 |
+
print(self.bucket_name)
|
88 |
|
89 |
|
90 |
def setup(self):
|
|
|
152 |
header = file_buffer.read(12)
|
153 |
print(header)
|
154 |
file_format = None
|
155 |
+
bucket_name = self.bucket_name
|
156 |
if b'WAVE' in header:
|
157 |
file_format = 'wav'
|
158 |
elif b'OggS' in header:
|
|
|
222 |
|
223 |
|
224 |
s3_key = s3_url.split('/')[-1]
|
225 |
+
bucket_name = self.bucket_name
|
226 |
local_file_path = os.path.join(raw_dir,s3_key)
|
227 |
self.download_file_from_s3(self.s3_client,bucket_name,s3_key,local_file_path)
|
228 |
#voice_clone with styletts2
|
|
|
277 |
|
278 |
|
279 |
s3_key = s3_url.split('/')[-1]
|
280 |
+
bucket_name = self.bucket_name
|
281 |
local_file_path = os.path.join(raw_dir,s3_key)
|
282 |
self.download_file_from_s3(self.s3_client,bucket_name,s3_key,local_file_path)
|
283 |
#voice_clone with styletts2
|
|
|
319 |
|
320 |
|
321 |
s3_key = s3_url.split('/')[-1]
|
322 |
+
bucket_name = self.bucket_name
|
323 |
local_file_path = os.path.join(raw_dir,s3_key)
|
324 |
self.download_file_from_s3(self.s3_client,bucket_name,s3_key,local_file_path)
|
325 |
model,sampler = self.model,self.sampler
|