li cheng commited on
Commit
b0bcae6
·
1 Parent(s): 30b3066

unique id for url

Browse files
Files changed (1) hide show
  1. xtts.py +1 -1
xtts.py CHANGED
@@ -98,7 +98,7 @@ def download_sample(url):
98
  try:
99
  response = requests.get(url)
100
  if response.status_code == 200:
101
- id=f'{sample_root}/{response.headers["etag"]}.pt'.replace('"','')
102
  if(os.path.exists(id)):
103
  return "", id
104
  with tempfile.NamedTemporaryFile(mode="wb", suffix=".wav", delete=False) as temp_file:
 
98
  try:
99
  response = requests.get(url)
100
  if response.status_code == 200:
101
+ id=f'{sample_root}/{hash(f'{url}{response.headers["etag"]}')}.pt'.replace('"','')
102
  if(os.path.exists(id)):
103
  return "", id
104
  with tempfile.NamedTemporaryFile(mode="wb", suffix=".wav", delete=False) as temp_file: