-
-
Notifications
You must be signed in to change notification settings - Fork 859
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FIX] v1.33.0 can not chat in stream mode #1019
Comments
AttributeError: 'NoneType' object has no attribute 'model_extra' still exist |
Hey @thinker007, can you share more details?
|
[15:21:31.254144] ERROR khoj.processor.conversation.openai.utils: Error in llm_thread: 'NoneType' object has no attribute 'model_extra' utils.py:227 only after v1.33.0 was released khoj macos. Self-hosting Setup method |
It seems "cost = chunk.usage.model_extra.get("estimated_cost") or 0 # Estimated costs returned by DeepInfra API" this is the key, after comment it out fix this error |
fix AttributeError: 'NoneType' object has no attribute 'model_extra' khoj-ai#1019
@debanjum I think I got it |
Describe the bug
A clear and concise description of what the bug is. Please include what you were expecting to happen vs. what actually happened.
/khoj/src/khoj/processor/conversation/openai/utils.py:103 in │
│ completion_with_backoff │
│ │
│ 100 │ # Calculate cost of chat │
│ 101 │ input_tokens = chunk.usage.prompt_tokens if hasattr(chunk, "usa │
│ else 0 │
│ 102 │ output_tokens = chunk.usage.completion_tokens if hasattr(chunk, │
│ chunk.usage else 0 │
│ ❱ 103 │ cost = chunk.usage.model_extra.get("estimated_cost") or 0 # Es │
│ returned by DeepInfra API │
│ 104 │ tracer["usage"] = get_chat_usage_metrics(model_name, input_toke │
│ tracer.get("usage"), cost) │
│ 105 │ │
│ 106 │ # Save conversation trace │
╰───────────────────────────────────────────────────────────────────────────╯
AttributeError: 'NoneType' object has no attribute 'model_extra'
To Reproduce
Steps to reproduce the behavior:
After model setting ,just chat no return
Screenshots
If applicable, add screenshots to help explain your problem.
Platform
If self-hosted
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: