Invalid response object from API: '{"object":"error","message":"**NETWORK ERROR DUE TO HIGH TRAFFIC. PLEASE REGENERATE OR REFRESH THIS PAGE.**\\n\\n(probability tensor contains either `inf`, `nan` or element < 0)","code":50001}'
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 39.5k
- Forks
- 4.8k
- PR merge metrics
- No merged PRs in 30d
Description
I encountered an strange issue. I used the solutionin this issue (https://github.com/lm-sys/FastChat/issues/412), and the curl command is working fine, and the web interface is also good, I can have a normal chat on gradio web server. but when I create an agent by langchain,It runs with error:
> Retrying langchain.chat_models.openai.ChatOpenAI.completion_with_retry.._completion_with_retry in 10.0 seconds as it raised APIError: Invalid response object from API: '{"object":"error","message":"**NETWORK ERROR DUE TO HIGH TRAFFIC. PLEASE REGENERATE OR REFRESH THIS PAGE.**\\n\\n(probability tensor contains either `inf`, `nan` or element < 0)","code":50001}' (HTTP response code was 400).
Error in StdOutCallbackHandler.on_retry callback: 'StdOutCallbackHandler' object has no attribute 'on_retry'
My langchain code:
```python
from langchain.chat_models import ChatOpenAI
from langchain.llms import OpenAI
from langchain.document_loaders import TextLoader
from langchain.embeddings import OpenAIEmbeddings
from langchain.indexes import VectorstoreIndexCreator
from langchain.callbacks.streaming_stdout import StreamingStdOutCallbackHandler
llm = ChatOpenAI(model="chatglm2-6b",temperature=0.0001,verbose=True)
from langchain.base_language import BaseLanguageModel
from langchain.chains.llm import LLMChain
from langchain.prompts.few_shot import FewShotPromptTemplate
from langchain.prompts.prompt import PromptTemplate
prompt='''\
what's the answer of {expr}。
'''
chain = LLMChain(llm=llm,prompt=PromptTemplate.from_template(prompt))
chain.run("3 times 4")
```
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the LangChain ChatOpenAI example in the issue and compare its request with the working curl and Gradio requests. Investigate the API response and callback error together; done means the shown agent request completes without the HTTP 400 or invalid-response error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- ai, api
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100