Tonic commited on
Commit
fe4d2da
1 Parent(s): 00136b0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -125,12 +125,12 @@ def translate_text(input_text, input_language):
125
  Translate text from one language to another.
126
  """
127
  try:
128
- text_translation_result = client.predict(
129
  task="T2TT (Text to Text translation)",
130
  input_text=input_text,
131
- source_language=Auto-detect, # Auto-detect or specified language
132
  target_language=input_language,
133
- api_name="/run_text_translation" # Hypothetical API endpoint for text translation
134
  )
135
 
136
  translated_text = text_translation_result['translated_text']
@@ -143,11 +143,11 @@ def convert_text_to_speech(input_text, input_language):
143
  Convert text to speech in the specified language.
144
  """
145
  try:
146
- text_to_speech_result = client.predict(
147
  task="T2ST (Text to Speech translation)",
148
  input_text=input_text,
149
  language=input_language,
150
- api_name="/run_text_to_speech" # Hypothetical API endpoint for text-to-speech
151
  )
152
 
153
  # Assuming the API returns a file path or similar identifier for the audio
 
125
  Translate text from one language to another.
126
  """
127
  try:
128
+ text_translation_result = seamless_client.predict(
129
  task="T2TT (Text to Text translation)",
130
  input_text=input_text,
131
+ source_language="Auto-detect", # If auto-detection is supported
132
  target_language=input_language,
133
+ api_name="/run_text_translation" # Adjust the API endpoint as needed
134
  )
135
 
136
  translated_text = text_translation_result['translated_text']
 
143
  Convert text to speech in the specified language.
144
  """
145
  try:
146
+ text_to_speech_result = seamless_client.predict(
147
  task="T2ST (Text to Speech translation)",
148
  input_text=input_text,
149
  language=input_language,
150
+ api_name="/run_text_to_speech" # Adjust the API endpoint as needed
151
  )
152
 
153
  # Assuming the API returns a file path or similar identifier for the audio