PeterH0323 / Streamer-Sales

Streamer-Sales 销冠 —— 卖货主播 LLM 大模型🛒🎁,一个能够根据给定的商品特点从激发用户购买意愿角度出发进行商品解说的卖货主播大模型。🚀⭐内含详细的数据生成流程❗ 📦另外还集成了 LMDeploy 加速推理🚀、RAG检索增强生成 📚、TTS文字转语音🔊、数字人生成 🦸、 Agent 使用网络查询实时信息🌐、ASR 语音转文字🎙️
https://openxlab.org.cn/apps/detail/HinGwenWong/Streamer-Sales
Apache License 2.0
1.47k stars 207 forks source link

File ./work_dirs/digital_human/avator_info.json not found when start app. #6

Closed T-bagwell closed 5 days ago

T-bagwell commented 5 days ago
音频参考文本: 列车巡游银河,我不一定都能帮上忙,但只要是花钱能解决的事,尽管和我说吧。
['列车巡游银河,我不一定都能帮上忙,但只要是花钱能解决的事,尽管和我说吧。']
['zh']
Building prefix dict from the default dictionary ...
Loading model from cache /tmp/jieba.cache
Loading model cost 0.315 seconds.
Prefix dict has been built succesfully.
Fetching 4 files: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 4/4 [00:00<00:00, 1575.18it/s]
Fetching 5 files: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 5/5 [00:00<00:00, 2426.14it/s]
Loading models...
Loaded models done !...
2024-07-02 13:53:06.585 Uncaught app exception
Traceback (most recent call last):
  File "/home/lq/miniconda3/envs/streamer-sales/lib/python3.10/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 600, in _run_script
    exec(code, module.__dict__)
  File "/home/lq/Streamer-Sales/app.py", line 33, in <module>
    from utils.model_loader import RAG_RETRIEVER  # isort:skip
  File "/home/lq/Streamer-Sales/utils/model_loader.py", line 39, in <module>
    DIGITAL_HUMAN_HANDLER = digital_human_preprocess(
  File "/home/lq/miniconda3/envs/streamer-sales/lib/python3.10/site-packages/streamlit/runtime/caching/cache_utils.py", line 165, in wrapper
    return cached_func(*args, **kwargs)
  File "/home/lq/miniconda3/envs/streamer-sales/lib/python3.10/site-packages/streamlit/runtime/caching/cache_utils.py", line 194, in __call__
    return self._get_or_create_cached_value(args, kwargs)
  File "/home/lq/miniconda3/envs/streamer-sales/lib/python3.10/site-packages/streamlit/runtime/caching/cache_utils.py", line 221, in _get_or_create_cached_value
    return self._handle_cache_miss(cache, value_key, func_args, func_kwargs)
  File "/home/lq/miniconda3/envs/streamer-sales/lib/python3.10/site-packages/streamlit/runtime/caching/cache_utils.py", line 277, in _handle_cache_miss
    computed_value = self._info.func(*func_args, **func_kwargs)
  File "/home/lq/Streamer-Sales/utils/digital_human/realtime_inference.py", line 425, in digital_human_preprocess
    avatar = Avatar(
  File "/home/lq/miniconda3/envs/streamer-sales/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "/home/lq/miniconda3/envs/streamer-sales/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 129, in <lambda>
    func = cast(F, lambda *args, **kwargs: orig_func(*args, **kwargs))
  File "/home/lq/Streamer-Sales/utils/digital_human/realtime_inference.py", line 212, in __init__
    self.init(vae_model=vae, face_parsing_model=face_parsing_model)
  File "/home/lq/Streamer-Sales/utils/digital_human/realtime_inference.py", line 240, in init
    with open(self.avatar_info_path, "r") as f:
FileNotFoundError: [Errno 2] No such file or directory: './work_dirs/digital_human/avator_info.json'
/home/lq/miniconda3/envs/streamer-sales/lib/python3.10/site-packages/streamlit/watcher/local_sources_watcher.py:196: UserWarning: Torchaudio's I/O functions now support par-call bakcend dispatch. Importing backend implementation directly is no longer guaranteed to work. Please use `backend` keyword with load/save/info function, instead of calling the udnerlying implementation directly.
  lambda m: [p for p in m.__path__._path],
T-bagwell commented 5 days ago

append more detail informations

 streamlit run app.py --server.address=192.168.3.208 --server.port 17860

Collecting usage statistics. To deactivate, set browser.gatherUsageStats to false.

  You can now view your Streamlit app in your browser.

  URL: http://192.168.3.208:17860

/home/lq/miniconda3/envs/streamer-sales/lib/python3.10/site-packages/langchain/_api/module_import.py:120: LangChainDeprecationWarning: Importing HuggingFaceEmbeddings from langchain.embeddings is deprecated. Please replace deprecated imports:

>> from langchain.embeddings import HuggingFaceEmbeddings

with new imports of:

>> from langchain_community.embeddings import HuggingFaceEmbeddings

  warn_deprecated(
/home/lq/miniconda3/envs/streamer-sales/lib/python3.10/site-packages/langchain/_api/module_import.py:120: LangChainDeprecationWarning: Importing FAISS from langchain.vectorstores is deprecated. Please replace deprecated imports:

>> from langchain.vectorstores import FAISS

with new imports of:

>> from langchain_community.vectorstores import FAISS

  warn_deprecated(
07/02/2024 16:18:13 - [INFO] -numexpr.utils->>>    Note: NumExpr detected 32 cores but "NUMEXPR_MAX_THREADS" not set, so enforcing safe limit of 16.
07/02/2024 16:18:13 - [INFO] -numexpr.utils->>>    NumExpr defaulting to 16 threads.
/home/lq/miniconda3/envs/streamer-sales/lib/python3.10/site-packages/langchain/_api/module_import.py:120: LangChainDeprecationWarning: Importing HuggingFaceEmbeddings from langchain.embeddings is deprecated. Please replace deprecated imports:

>> from langchain.embeddings import HuggingFaceEmbeddings

with new imports of:

>> from langchain_community.embeddings import HuggingFaceEmbeddings

  warn_deprecated(
/home/lq/miniconda3/envs/streamer-sales/lib/python3.10/site-packages/langchain/_api/module_import.py:120: LangChainDeprecationWarning: Importing FAISS from langchain.vectorstores is deprecated. Please replace deprecated imports:

>> from langchain.vectorstores import FAISS

with new imports of:

>> from langchain_community.vectorstores import FAISS

  warn_deprecated(
2024-07-02 16:18:13,782 - modelscope - INFO - PyTorch version 2.1.2 Found.
2024-07-02 16:18:13,783 - modelscope - INFO - Loading ast index from /home/lq/.cache/modelscope/ast_indexer
2024-07-02 16:18:13,802 - modelscope - INFO - Loading done! Current index file version is 1.14.0, with md5 bf2a60ad709795cf018ef95ae3c754e6 and a total number of 976 components indexed
07/02/2024 16:18:14 - [INFO] -root->>>    new registry table has been added: preprocessor_classes
07/02/2024 16:18:15 - [INFO] -root->>>    new registry table has been added: adaptor_classes
07/02/2024 16:18:15 - [INFO] -root->>>    new registry table has been added: lid_predictor_classes
[2024-07-02 16:18:16,014] [INFO] [real_accelerator.py:203:get_accelerator] Setting ds_accelerator to cuda (auto detect)
 [WARNING]  Please specify the CUTLASS repo directory as environment variable $CUTLASS_PATH
No ROCm runtime is found, using ROCM_HOME='/opt/rocm'
 [WARNING]  sparse_attn requires a torch version >= 1.5 and < 2.0 but detected 2.1
 [WARNING]  using untested triton version (2.1.0), only 1.0.0 is known to be compatible
/home/lq/miniconda3/envs/streamer-sales/lib/python3.10/site-packages/torch/utils/_contextlib.py:125: UserWarning: Decorating classes is deprecated and will be disabled in future versions. You should only decorate functions or methods. To preserve the current behavior of class decoration, you can directly decorate the `__init__` method and nothing else.
  warnings.warn("Decorating classes is deprecated and will be disabled in "
2024-07-02 16:18:20,934 - modelscope - WARNING - Model revision not specified, use revision: v0.0.3
2024-07-02 16:18:40,281 - modelscope - WARNING - Model revision not specified, use revision: v0.0.1
2024-07-02 16:18:40.518 | INFO     | utils.rag.retriever:__init__:201 - loading test2vec and rerank models
gpt_path dir = weights/gpt_sovits_weights/star/艾丝妲-e10.ckpt
sovits_path dir = weights/gpt_sovits_weights/star/艾丝妲_e25_s925.pth
Fetching 11 files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 11/11 [00:00<00:00, 3584.60it/s]
cnhubert_base_path dir = /home/lq/Streamer-Sales/weights/gpt_sovits_weights/pretrain/chinese-hubert-base
bert_path dir = /home/lq/Streamer-Sales/weights/gpt_sovits_weights/pretrain/chinese-roberta-wwm-ext-large
Loading tts bert model...
load tts bert model done!
Loading tts ssl model...
Some weights of the model checkpoint at /home/lq/Streamer-Sales/weights/gpt_sovits_weights/pretrain/chinese-hubert-base were not used when initializing HubertModel: ['encoder.pos_conv_embed.conv.weight_v', 'encoder.pos_conv_embed.conv.weight_g']
- This IS expected if you are initializing HubertModel from the checkpoint of a model trained on another task or with another architecture (e.g. initializing a BertForSequenceClassification model from a BertForPreTraining model).
- This IS NOT expected if you are initializing HubertModel from the checkpoint of a model that you expect to be exactly identical (initializing a BertForSequenceClassification model from a BertForSequenceClassification model).
Some weights of HubertModel were not initialized from the model checkpoint at /home/lq/Streamer-Sales/weights/gpt_sovits_weights/pretrain/chinese-hubert-base and are newly initialized: ['encoder.pos_conv_embed.conv.parametrizations.weight.original0', 'encoder.pos_conv_embed.conv.parametrizations.weight.original1']
You should probably TRAIN this model on a down-stream task to be able to use it for predictions and inference.
load tts ssl model done !
Number of parameter: 77.49M
/home/lq/miniconda3/envs/streamer-sales/lib/python3.10/site-packages/torch/nn/utils/weight_norm.py:30: UserWarning: torch.nn.utils.weight_norm is deprecated in favor of torch.nn.utils.parametrizations.weight_norm.
  warnings.warn("torch.nn.utils.weight_norm is deprecated in favor of torch.nn.utils.parametrizations.weight_norm.")
<All keys matched successfully>
====================
加载参考音频 。。。
加载 参考音频 用时:  0.804985761642456
/home/lq/miniconda3/envs/streamer-sales/lib/python3.10/site-packages/torch/functional.py:650: UserWarning: stft with return_complex=False is deprecated. In a future pytorch release, stft will return complex tensors for all inputs, and return_complex=False will raise an error.
Note: you can still call torch.view_as_real on the complex output to recover the old return format. (Triggered internally at /opt/conda/conda-bld/pytorch_1702400410390/work/aten/src/ATen/native/SpectralOps.cpp:863.)
  return _VF.stft(input, n_fft, hop_length, win_length, window,  # type: ignore[attr-defined]
get_spepc 用时:  0.01583099365234375
====================
音频参考文本: 列车巡游银河,我不一定都能帮上忙,但只要是花钱能解决的事,尽管和我说吧。
['列车巡游银河,我不一定都能帮上忙,但只要是花钱能解决的事,尽管和我说吧。']
['zh']
Building prefix dict from the default dictionary ...
Loading model from cache /tmp/jieba.cache
Loading model cost 0.281 seconds.
Prefix dict has been built succesfully.
Fetching 4 files: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 4/4 [00:00<00:00, 2117.00it/s]
Fetching 5 files: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 5/5 [00:00<00:00, 4515.83it/s]
Loading models...
Loaded models done !...
2024-07-02 16:18:51.551 Uncaught app exception
Traceback (most recent call last):
  File "/home/lq/miniconda3/envs/streamer-sales/lib/python3.10/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 600, in _run_script
    exec(code, module.__dict__)
  File "/home/lq/Streamer-Sales/app.py", line 33, in <module>
    from utils.model_loader import RAG_RETRIEVER  # isort:skip
  File "/home/lq/Streamer-Sales/utils/model_loader.py", line 39, in <module>
    DIGITAL_HUMAN_HANDLER = digital_human_preprocess(
  File "/home/lq/miniconda3/envs/streamer-sales/lib/python3.10/site-packages/streamlit/runtime/caching/cache_utils.py", line 165, in wrapper
    return cached_func(*args, **kwargs)
  File "/home/lq/miniconda3/envs/streamer-sales/lib/python3.10/site-packages/streamlit/runtime/caching/cache_utils.py", line 194, in __call__
    return self._get_or_create_cached_value(args, kwargs)
  File "/home/lq/miniconda3/envs/streamer-sales/lib/python3.10/site-packages/streamlit/runtime/caching/cache_utils.py", line 221, in _get_or_create_cached_value
    return self._handle_cache_miss(cache, value_key, func_args, func_kwargs)
  File "/home/lq/miniconda3/envs/streamer-sales/lib/python3.10/site-packages/streamlit/runtime/caching/cache_utils.py", line 277, in _handle_cache_miss
    computed_value = self._info.func(*func_args, **func_kwargs)
  File "/home/lq/Streamer-Sales/utils/digital_human/realtime_inference.py", line 425, in digital_human_preprocess
    avatar = Avatar(
  File "/home/lq/miniconda3/envs/streamer-sales/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "/home/lq/miniconda3/envs/streamer-sales/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 129, in <lambda>
    func = cast(F, lambda *args, **kwargs: orig_func(*args, **kwargs))
  File "/home/lq/Streamer-Sales/utils/digital_human/realtime_inference.py", line 212, in __init__
    self.init(vae_model=vae, face_parsing_model=face_parsing_model)
  File "/home/lq/Streamer-Sales/utils/digital_human/realtime_inference.py", line 240, in init
    with open(self.avatar_info_path, "r") as f:
FileNotFoundError: [Errno 2] No such file or directory: './work_dirs/digital_human/avator_info.json'
/home/lq/miniconda3/envs/streamer-sales/lib/python3.10/site-packages/streamlit/watcher/local_sources_watcher.py:196: UserWarning: Torchaudio's I/O functions now support par-call bakcend dispatch. Importing backend implementation directly is no longer guaranteed to work. Please use `backend` keyword with load/save/info function, instead of calling the udnerlying implementation directly.
  lambda m: [p for p in m.__path__._path],
T-bagwell commented 5 days ago

As Wong·HinGwen said in WeChat group:

remove ./work_dirs/digital_human dir can pass when start app