THUDM / WebGLM

WebGLM: An Efficient Web-enhanced Question Answering System (KDD 2023)
Apache License 2.0
1.57k stars 135 forks source link

按照步骤安装后,提示search类有问题? #38

Closed hanjingsu closed 1 year ago

hanjingsu commented 1 year ago

具体错误如下,请帮诊断下: File "cli_demo.py", line 1, in from model import load_model, citation_correction File "/data/home/justinsu/WebGLM/model/init.py", line 1, in from .modeling_webglm import WebGLM, load_model File "/data/home/justinsu/WebGLM/model/modeling_webglm.py", line 1, in from .retriever import ReferenceRetiever File "/data/home/justinsu/WebGLM/model/retriever/init.py", line 1, in from .searching import create_searcher File "/data/home/justinsu/WebGLM/model/retriever/searching/init.py", line 1, in from .serpapi import Searcher as SerpAPISearcher File "/data/home/justinsu/WebGLM/model/retriever/searching/serpapi.py", line 3, in from .searcher import * File "/data/home/justinsu/WebGLM/model/retriever/searching/searcher.py", line 19, in class SearcherInterface: File "/data/home/justinsu/WebGLM/model/retriever/searching/searcher.py", line 20, in SearcherInterface def search(self, query) -> list[SearchResult]: TypeError: 'type' object is not subscriptable

Longin-Yu commented 1 year ago

感谢提醒!我们现在已经修复了这个问题(使用 Generic 类型声明)

hanjingsu commented 1 year ago

感谢提醒!我们现在已经修复了这个问题(使用 Generic 类型声明)

基于修改后的试了下,貌似还是提示同样的问题。具体日志请参考,谢谢: python cli_demo.py -w THUDM/WebGLM-2B --searcher bing Traceback (most recent call last): File "cli_demo.py", line 1, in from model import load_model, citation_correction File "/data/home/justinsu/WebGLM/model/init.py", line 1, in from .modeling_webglm import WebGLM, load_model File "/data/home/justinsu/WebGLM/model/modeling_webglm.py", line 1, in from .retriever import ReferenceRetiever File "/data/home/justinsu/WebGLM/model/retriever/init.py", line 2, in from .searching import create_searcher File "/data/home/justinsu/WebGLM/model/retriever/searching/init.py", line 1, in from .serpapi import Searcher as SerpAPISearcher File "/data/home/justinsu/WebGLM/model/retriever/searching/serpapi.py", line 31, in def dump_results(results: list[SearchResult]): TypeError: 'type' object is not subscriptable

Longin-Yu commented 1 year ago

感谢指出,现在再尝试一下?

hanjingsu commented 1 year ago

已经解决。