SillyTavern / SillyTavern-Extras

Extensions API for SillyTavern.
GNU Affero General Public License v3.0
560 stars 133 forks source link

changes to requirements-complete.txt to make it work #183

Open eyalgi11 opened 12 months ago

eyalgi11 commented 12 months ago

i needed to change the default file to this to make this work

numpy flask flask-cloudflared flask-cors flask-compress markdown Pillow colorama webuiapi --extra-index-url https://download.pytorch.org/whl/cu118 torch torchvision torchaudio accelerate>=0.20.3 transformers diffusers silero-api-server chromadb sentence_transformers edge-tts

vosk sounddevice openai-whisper

TTS fastapi wxpython; sys_platform == 'win32' or sys_platform == 'darwin' mecab-python3 unidic-lite py-espeak-ng TTS[ja]

Cohee1207 commented 12 months ago

So basically remove fixed versions, yeah?

eyalgi11 commented 12 months ago

yea

GoAwayNow commented 11 months ago

The conflict comes from TTS requiring numpy 1.22.0 exactly while some others require 1.22.5 minimum. Under python 3.10, TTS always requires 1.22.0, so this seems to result in older versions of some other packages being installed.

Cohee1207 commented 11 months ago

I applied the change and split requirements into main/coqui/rvc. complete file was removed

rosx27 commented 11 months ago

lib installation takes too long. but i hope this fixes the issue.

UPDATE: due to module not found error, i specified the version of these two libraries: from sentence-transformers to sentence-transformers==2.2.1 from pypika to pypika==0.48.8 note: i ignored "chromadb 0.4.17 requires pypika>=0.48.9, but you have pypika 0.48.8 which is incompatible."

rosx27 commented 11 months ago

i think the implementation of chromadb should also be updated, there is a new version of chromadb, i think the outdated implementation of this is the reason why i get this error:

Collection chat-a3e9a2fc0d89d922b32d993ebe1d6863 does not exist.
Collection chat-da9754979ae069dedf0b4f5f169125f7 does not exist.
Collection chat-118306466f01292cff2bc2f77ad0c0d4 does not exist.
192.168.1.2 - - [16/Nov/2023 23:18:01] "POST /api/chromadb/multiquery HTTP/1.1" 200 -
192.168.1.2 - - [16/Nov/2023 23:19:46] "OPTIONS /api/chromadb HTTP/1.1" 200 -
[2023-11-16 23:19:46,058] ERROR in app: Exception on /api/chromadb [POST]
Traceback (most recent call last):
  File "D:\.conda\envs\ext\Lib\site-packages\flask\app.py", line 1455, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\.conda\envs\ext\Lib\site-packages\flask\app.py", line 869, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\.conda\envs\ext\Lib\site-packages\flask_cors\extension.py", line 176, in wrapped_function
    return cors_after_request(app.make_response(f(*args, **kwargs)))
                                                ^^^^^^^^^^^^^^^^^^
  File "D:\.conda\envs\ext\Lib\site-packages\flask\app.py", line 867, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\.conda\envs\ext\Lib\site-packages\flask\app.py", line 852, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\AI\LLM\SillyTavern-extras\server.py", line 432, in decorated_view
    return fn(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^
  File "D:\AI\LLM\SillyTavern-extras\server.py", line 889, in chromadb_add_messages
    collection = chromadb_client.get_or_create_collection(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\.conda\envs\ext\Lib\site-packages\chromadb\api\client.py", line 226, in get_or_create_collection
    return self._server.get_or_create_collection(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\.conda\envs\ext\Lib\site-packages\chromadb\telemetry\opentelemetry\__init__.py", line 127, in wrapper
    return f(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^
  File "D:\.conda\envs\ext\Lib\site-packages\chromadb\api\segment.py", line 216, in get_or_create_collection
    return self.create_collection(  # type: ignore
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\.conda\envs\ext\Lib\site-packages\chromadb\telemetry\opentelemetry\__init__.py", line 127, in wrapper
    return f(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^
  File "D:\.conda\envs\ext\Lib\site-packages\chromadb\api\segment.py", line 190, in create_collection
    return Collection(
           ^^^^^^^^^^^
  File "D:\.conda\envs\ext\Lib\site-packages\chromadb\api\models\Collection.py", line 85, in __init__
    validate_embedding_function(embedding_function)
  File "D:\.conda\envs\ext\Lib\site-packages\chromadb\api\types.py", line 210, in validate_embedding_function
    raise ValueError(
ValueError: Expected EmbeddingFunction.__call__ to have the following signature: odict_keys(['self', 'input']), got odict_keys(['self', 'args', 'kwargs'])
Please see https://docs.trychroma.com/embeddings for details of the EmbeddingFunction interface.
Please note the recent change to the EmbeddingFunction interface: https://docs.trychroma.com/migration#migration-to-0416---november-7-2023

also, there is error in rvc, coqui-tts:

Initializing Coqui TTS client in CPU mode
Traceback (most recent call last):
  File "D:\.conda\envs\ext\Lib\site-packages\MeCab\__init__.py", line 133, in __init__
    super(Tagger, self).__init__(args)
RuntimeError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "D:\AI\LLM\SillyTavern-extras\server.py", line 399, in <module>
    import modules.text_to_speech.coqui.coqui_module as coqui_module
  File "D:\AI\LLM\SillyTavern-extras\modules\text_to_speech\coqui\coqui_module.py", line 22, in <module>
    from TTS.api import TTS
  File "D:\.conda\envs\ext\Lib\site-packages\TTS\api.py", line 12, in <module>
    from TTS.utils.synthesizer import Synthesizer
  File "D:\.conda\envs\ext\Lib\site-packages\TTS\utils\synthesizer.py", line 11, in <module>
    from TTS.tts.configs.vits_config import VitsConfig
  File "D:\.conda\envs\ext\Lib\site-packages\TTS\tts\configs\vits_config.py", line 5, in <module>
    from TTS.tts.models.vits import VitsArgs, VitsAudioConfig
  File "D:\.conda\envs\ext\Lib\site-packages\TTS\tts\models\vits.py", line 33, in <module>
    from TTS.tts.utils.text.characters import BaseCharacters, BaseVocabulary, _characters, _pad, _phonemes, _punctuations
  File "D:\.conda\envs\ext\Lib\site-packages\TTS\tts\utils\text\__init__.py", line 1, in <module>
    from TTS.tts.utils.text.tokenizer import TTSTokenizer
  File "D:\.conda\envs\ext\Lib\site-packages\TTS\tts\utils\text\tokenizer.py", line 5, in <module>
    from TTS.tts.utils.text.phonemizers import DEF_LANG_TO_PHONEMIZER, get_phonemizer_by_name
  File "D:\.conda\envs\ext\Lib\site-packages\TTS\tts\utils\text\phonemizers\__init__.py", line 10, in <module>
    from TTS.tts.utils.text.phonemizers.ja_jp_phonemizer import JA_JP_Phonemizer
  File "D:\.conda\envs\ext\Lib\site-packages\TTS\tts\utils\text\phonemizers\ja_jp_phonemizer.py", line 3, in <module>
    from TTS.tts.utils.text.japanese.phonemizer import japanese_text_to_phonemes
  File "D:\.conda\envs\ext\Lib\site-packages\TTS\tts\utils\text\japanese\phonemizer.py", line 355, in <module>
    _TAGGER = MeCab.Tagger()
              ^^^^^^^^^^^^^^
  File "D:\.conda\envs\ext\Lib\site-packages\MeCab\__init__.py", line 135, in __init__
    raise RuntimeError(error_info(rawargs)) from ee
RuntimeError:
----------------------------------------------------------

Failed initializing MeCab. Please see the README for possible solutions:

    https://github.com/SamuraiT/mecab-python3#common-issues

If you are still having trouble, please file an issue here, and include the
ERROR DETAILS below:

    https://github.com/SamuraiT/mecab-python3/issues

issueを英語で書く必要はありません。

------------------- ERROR DETAILS ------------------------
arguments:
[ifs] no such file or directory: c:\mecab\mecabrc
----------------------------------------------------------

docs points me here. i'm installing it right now, will try to update tomorrow it this fixes the error.

Cohee1207 commented 11 months ago

You're right about chroma, that was the only module I didn't test after the update and it broke, the irony. Hopefully fixed now. As for coqui and rvc, both worked for me. The expected order of requirements installation is the following: requirements => rvc => coqui And coqui still sucks, at least as a package to work with, because all of these issues with pip requirements.

rosx27 commented 11 months ago

that was quick. anyway, i'll pull your updates now and test it.

And coqui still sucks, at least as a package to work with

haha yeah? i've only used silero-server, never tried other tts yet. i was hoping to give it a try since i now have some time to tinker with tts due to work.

GoAwayNow commented 11 months ago

Should ChromaDB be versioned in the requirements? The migration logs on the site are only a few months apart, there could be some risk of it making breaking changes again before long.

rosx27 commented 11 months ago

Should ChromaDB be versioned in the requirements? The migration logs on the site are only a few months apart, there could be some risk of it making breaking changes again before long.

i think so, since the changes were to address multi modal embeddings and I think that's a way to go, and the risk of revising, and possibly breaking the revised implementation due to another update in the future should be acceptable since the current implementation of chromadb is not working.

anyway, here's my update on the current commit [51a6809]: the chroma API posts, however, retrieval via manual export of the json file or automatic retrieval is not working and giving me an error "chat history [---] not found." or something, I'll update this later when I get home.

EDIT: image

thats the output i get when i click "export" under smart context

GoAwayNow commented 11 months ago

So, I'm running in a modified version of the Colab with ChromaDB persistence via Google Drive, and the current commit + latest chromadb works fine for me. Notably, though, I got similar errors before extras was updated for the latest chromadb versions. Specifically, I got those errors because I ran with the new version of chromadb, and then tried to roll back to 0.4.10, but my chromadb.sqlite3 had been changed. This is actually why I was bringing up adding the version, because future changes could make it impossible for users to roll back.