fdbw commited on
Commit
d120b8d
·
verified ·
1 Parent(s): 3c0f3a6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -38,7 +38,7 @@
38
  mt_tokenizer = AutoTokenizer.from_pretrained(MT_MODEL_ID, trust_remote_code=True)
39
  mt_model = AutoModelForCausalLM.from_pretrained(
40
  MT_MODEL_ID,
41
- torch_dtype=TORCH_DTYPE,
42
  device_map="auto" if DEVICE == "cuda" else None,
43
  trust_remote_code=True
44
  )
@@ -232,7 +232,7 @@ def on_translate_click(src_text, src_lang_choice, tgt_lang_choice, history):
232
  sources=["microphone"],
233
  type="filepath",
234
  label="2 & 3- 点击录音 / 停止录音 (支持播放重听波形)",
235
- waveform_options={"waveform_progress_color": "#FF5500"}
236
  )
237
  src_text_box = gr.Textbox(
238
  label="源语言文字 (可手动校对)",
 
38
  mt_tokenizer = AutoTokenizer.from_pretrained(MT_MODEL_ID, trust_remote_code=True)
39
  mt_model = AutoModelForCausalLM.from_pretrained(
40
  MT_MODEL_ID,
41
+ dtype=TORCH_DTYPE, # transformers 新版已弃用 torch_dtype,改用 dtype
42
  device_map="auto" if DEVICE == "cuda" else None,
43
  trust_remote_code=True
44
  )
 
232
  sources=["microphone"],
233
  type="filepath",
234
  label="2 & 3- 点击录音 / 停止录音 (支持播放重听波形)",
235
+ waveform_options=gr.WaveformOptions(waveform_progress_color="#FF5500")
236
  )
237
  src_text_box = gr.Textbox(
238
  label="源语言文字 (可手动校对)",