archivartaunik commited on
Commit
82ff83b
·
verified ·
1 Parent(s): 04c273e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -10
app.py CHANGED
@@ -46,9 +46,7 @@ def transcribe_audio(audio_file: str) -> str:
46
  response = client.models.generate_content(
47
  model=MODEL_NAME_TH,
48
  contents=contents,
49
- config=types.GenerateContentConfig(
50
- temperature=0.2
51
- )
52
  )
53
 
54
  # Атрыманне адказу
@@ -76,9 +74,7 @@ def fix_subtitles_format(transcript: str) -> str:
76
  response_fix = client.models.generate_content(
77
  model=MODEL_NAME,
78
  contents=[{"text": prompt_fix}],
79
- config=types.GenerateContentConfig(
80
- temperature=0.2
81
- )
82
  )
83
  return response_fix.text.strip()
84
  except Exception as e:
@@ -185,9 +181,7 @@ def translate_transcript(transcript: str, target_language: str) -> tuple[str, st
185
  response = client.models.generate_content(
186
  model=MODEL_NAME,
187
  contents=[{"text": prompt_text}],
188
- config=types.GenerateContentConfig(
189
- temperature=0.2
190
- )
191
  )
192
  translated = response.text.strip()
193
  translated_srt_filename = "translated_subtitles.srt"
@@ -253,4 +247,4 @@ try:
253
  )
254
  except Exception as e:
255
  logger.critical(f"Крытычная памылка пры запуску праграмы: {str(e)}", exc_info=True)
256
- print(f"Крытычная памылка: {str(e)}")
 
46
  response = client.models.generate_content(
47
  model=MODEL_NAME_TH,
48
  contents=contents,
49
+ config={"temperature": 0.2}
 
 
50
  )
51
 
52
  # Атрыманне адказу
 
74
  response_fix = client.models.generate_content(
75
  model=MODEL_NAME,
76
  contents=[{"text": prompt_fix}],
77
+ config={"temperature": 0.2}
 
 
78
  )
79
  return response_fix.text.strip()
80
  except Exception as e:
 
181
  response = client.models.generate_content(
182
  model=MODEL_NAME,
183
  contents=[{"text": prompt_text}],
184
+ config={"temperature": 0.2}
 
 
185
  )
186
  translated = response.text.strip()
187
  translated_srt_filename = "translated_subtitles.srt"
 
247
  )
248
  except Exception as e:
249
  logger.critical(f"Крытычная памылка пры запуску праграмы: {str(e)}", exc_info=True)
250
+ print(f"Крытычная памылка: {str(e)}")