severian42 / GraphRAG-Local-UI

GraphRAG using Local LLMs - Features robust API and multiple apps for Indexing/Prompt Tuning/Query/Chat/Visualizing/Etc. This is meant to be the ultimate GraphRAG/KG local LLM app.
MIT License
1.51k stars 173 forks source link

AttributeError: 'NoneType' object has no attribute 'rstrip' #69

Open 26Ssr opened 1 month ago

26Ssr commented 1 month ago

微信图片_20240729110636 When I launch the Indexing and prompt tuning UI, I get the error.

And I dont want to use ollama ,so I skip (If using Ollama for embeddings, launch the embedding proxy: python embedding_proxy.py --port 11435 --host http://localhost:11434) Im not sure maybe it will affect thelaunching of index?

26Ssr commented 1 month ago

if I want to change Ollama to xinference,what should i do

severian42 commented 1 month ago

Hey! If you don't want to use Ollama, then you can just skip launching and using the embeddings_proxy.py. You just need to adjust the .env variables to point to your base URL and model names that Xinference, or any other provider, is serving.

26Ssr commented 1 month ago

okay,TX for your answer. :) I creat the .env before the step five [Launch the Indexing and Prompt Tuning UI] as the shown below 微信图片_20240729164759, what should I change if I want to use xinference? then I creat the index_app.py and paste your code I run gradio index_app.py. but I get the error like the 1L , what mean AttributeError: 'NoneType' object has no attribute 'rstrip'

severian42 commented 1 month ago

Hmm....I keep trying but I can't seem to be able to replicate your error with the strip. The strip has to do with this function that helps clean up and standardize the base URL in case someone puts in /api or something on accident:

def normalize_api_base(api_base: str) -> str:
    """Normalize the API base URL by removing trailing slashes and /v1 suffixes."""
    api_base = api_base.rstrip('/')
    if api_base.endswith('/v1'):
        api_base = api_base[:-3]
    return api_base

This should interfere with anything hopefully since your env looks correct. I'll see if I can remove the function and still achieve my intended outcome. Also, are you launching the api.py server along with the index_app.py?

26Ssr commented 1 month ago

you mean for the step three: python api.py --host 0.0.0.0 --port 8012 --reload ? Yes, i launch the api serve before i launch the index_app.py. but after it successful i I quit. (ctrl +z)

the code is a part of the orginal, or i should add it into the index_app.py?

sliontc commented 1 month ago

Got same error, I feel the configuration is some confusing.

26Ssr commented 1 month ago

So what do I need to change

sliontc commented 1 month ago

So what do I need to change

I have no idea yet.

Tovi163 commented 1 month ago

you mean for the step three: python api.py --host 0.0.0.0 --port 8012 --reload ? Yes, i launch the api serve before i launch the index_app.py. but after it successful i I quit. (ctrl +z)

the code is a part of the orginal, or i should add it into the index_app.py?

@26Ssr python api.py --host 0.0.0.0 --port 8012 --reload , keep it alive