jhlfrfufyfn commited on
Commit
1897f0d
1 Parent(s): 19b7774

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -36,9 +36,12 @@ def tts(text: str):
36
  text = belarusify_russian_text(text)
37
  print("Belarusified text: ", text)
38
  # Sending a request to the fonemizer
39
- response = requests.post("http://fonemizer.nikuchin.fun/processText",
40
- data=text,
41
- headers={'Content-Type': 'text/plain'})
 
 
 
42
  if response.status_code != 200:
43
  raise Exception(f"Request to fonemizer failed with status code {response.status_code}")
44
  print(response.content)
 
36
  text = belarusify_russian_text(text)
37
  print("Belarusified text: ", text)
38
  # Sending a request to the fonemizer
39
+ headers = {'Content-Type': 'text/plain; charset=utf-8'} # Specify the charset as UTF-8
40
+
41
+ response = requests.post("http://fonemizer.nikuchin.fun/processText",
42
+ data=text.encode('utf-8'), # Encode the text as UTF-8
43
+ headers=headers)
44
+
45
  if response.status_code != 200:
46
  raise Exception(f"Request to fonemizer failed with status code {response.status_code}")
47
  print(response.content)