rahulnyk / knowledge_graph

Convert any text to a graph of knowledge. This can be used for Graph Augmented Generation or Knowledge Graph based QnA
1.53k stars 292 forks source link

502 Server Error: Bad Gateway for url: http://localhost:11434/api/generate #15

Closed ahchchchc closed 11 months ago

ahchchchc commented 11 months ago

Hi Rahul, Thank you for this wonderful project and I'm excited to play around with it. I have Installed Ollama and run ollama run zephyr in my terminal. When I running extract_graph and set regenerate=True, I get the following error:

An error occurred: 502 Server Error: Bad Gateway for url: http://localhost:11434/api/generate

ERROR ### Here is the buggy response: None

An error occurred: 502 Server Error: Bad Gateway for url: http://localhost:11434/api/generate

ERROR ### Here is the buggy response: None

An error occurred: 502 Server Error: Bad Gateway for url: http://localhost:11434/api/generate

ERROR ### Here is the buggy response: None

Traceback (most recent call last): File "/home/ubuntu/Documents/hxy/Knowledge_Graph/knowledge_graph-main/extract_graph.py", line 87, in concepts_list = df2Graph(df, model='zephyr:latest') ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/ubuntu/Documents/hxy/Knowledge_Graph/knowledge_graph-main/helpers/df_helpers.py", line 60, in df2Graph concept_list = np.concatenate(results).ravel().tolist() ^^^^^^^^^^^^^^^^^^^^^^^ ValueError: need at least one array to concatenate

Process finished with exit code 1

ahchchchc commented 11 months ago

I turned off the system proxy and set the following in code: proxies = { 'http': None, 'https': None, } with requests.post(url, json=payload, stream=True, proxies=proxies, verify=False) as response:

and the problem was solved

rahulnyk commented 11 months ago

Thanks for sharing this. I am sure many folks may see this issue.

happyrenxiaozhao commented 8 months ago

@ahchchchc hi, i have the same question, please tell me where to set the code, thanks!