Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Kedreamix committed Dec 4, 2024
1 parent 42ed167 commit f20997e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 11 deletions.
2 changes: 1 addition & 1 deletion TFG/MuseTalk.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import os
import time
import re
from huggingface_hub import snapshot_download
# from huggingface_hub import snapshot_download
import requests
import numpy as np
import cv2
Expand Down
19 changes: 12 additions & 7 deletions requirements_webui.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
# PyTorch and its dependencies
# These libraries include PyTorch and its related packages, supporting CUDA 11.8.
--extra-index-url https://download.pytorch.org/whl/cu118
torch==2.0.1
torchvision==0.15.2
torchaudio==2.0.2
--extra-index-url https://download.pytorch.org/whl/torch_stable.html
torch
torchvision
torchaudio
# torch==2.4.1+cu118
# torchvision==0.19.1+cu118
# torchaudio==2.4.1+cu118

# Installation source for PyTorch: -f https://download.pytorch.org/whl/cu118
# Example installation command:

# pip install torch==2.0.1 torchvision==0.15.2 torchaudio==2.0.2 --index-url https://download.pytorch.org/whl/cu118
# pip install torch==2.4.1 torchvision==0.19.1 torchaudio==2.4.1 --index-url https://download.pytorch.org/whl/cu118
# pip install tb-nightly -i https://mirrors.aliyun.com/pypi/simple

# General tools and libraries
Expand All @@ -23,7 +27,7 @@ spaces
moviepy
librosa==0.10.2
ultralytics # for wav2lipv2
gradio==4.16.0
gradio==4.*
scikit_learn==1.4.2

# SadTalker related libraries
Expand All @@ -46,6 +50,7 @@ matplotlib==3.7.5

# MuseTalk related libraries
diffusers==0.27.2
huggingface_hub==0.25.2
accelerate==0.28.0
opencv-python==4.9.0.80
soundfile==0.12.1
Expand All @@ -65,7 +70,7 @@ transformers==4.39.2
openai
modelscope
funasr>=1.0.0
edge-tts>=6.1.9
edge-tts>=6.1.18
openai-whisper
zhconv

Expand Down
7 changes: 4 additions & 3 deletions webui.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ def LLM_response(

# 生成VTT文件(如果TTS方法为'Edge-TTS')
tts_vtt = 'answer.vtt' if tts_method == 'Edge-TTS' else None

tts_vtt = None
return tts_audio, tts_vtt, answer

@calculate_time
Expand Down Expand Up @@ -267,7 +267,7 @@ def chat_response(system, message, history):

def modify_system_session(system: str) -> str:
if system is None or len(system) == 0:
system = default_system
system = DEFAULT_SYSTEM
llm.clear_history()
return system, system, []

Expand Down Expand Up @@ -312,6 +312,7 @@ def human_response(source_image, history, question_audio, talker_method, voice,
cut_method, question_audio, question, use_mic_voice,
mode_checkbox_group, sft_dropdown, prompt_text_cv, prompt_wav_upload, prompt_wav_record, seed, speed_factor,tts_method)
driven_vtt = 'answer.vtt' if tts_method == 'Edge-TTS' else None
driven_vtt = None
if driven_audio is None:
gr.Warning("音频没有正常生成,请检查TTS是否正确")
return None
Expand Down Expand Up @@ -364,7 +365,7 @@ def MuseTalker_response(source_video, bbox_shift, question_audio, text, voice,
# MuseTalker 视频生成
video = musetalker.inference_noprepare(driven_audio, source_video, bbox_shift, batch_size, fps=25)

return video, driven_vtt if driven_vtt else video
return (video, driven_vtt) if driven_vtt else video

GPT_SoVITS_ckpt = "GPT_SoVITS/pretrained_models"
def load_vits_model(gpt_path, sovits_path, progress=gr.Progress(track_tqdm=True)):
Expand Down

0 comments on commit f20997e

Please sign in to comment.