Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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 |
-
|
| 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=
|
| 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="源语言文字 (可手动校对)",
|