Skip to content
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

python main_gui.py 报连不上HF #18

Open
zhanghui-china opened this issue Oct 4, 2023 · 3 comments
Open

python main_gui.py 报连不上HF #18

zhanghui-china opened this issue Oct 4, 2023 · 3 comments

Comments

@zhanghui-china
Copy link

zhanghui-china commented Oct 4, 2023

(chatsql) zhanghui@ubuntu:/home1/zhanghui/ChatSQL$ python main_gui.py
Traceback (most recent call last):
File "/home/zhanghui/archiconda3/envs/chatsql/lib/python3.8/site-packages/urllib3/connectionpool.py", line 467, in _make_request
self._validate_conn(conn)
File "/home/zhanghui/archiconda3/envs/chatsql/lib/python3.8/site-packages/urllib3/connectionpool.py", line 1092, in _validate_conn
conn.connect()
File "/home/zhanghui/archiconda3/envs/chatsql/lib/python3.8/site-packages/urllib3/connection.py", line 642, in connect
sock_and_verified = _ssl_wrap_socket_and_match_hostname(
File "/home/zhanghui/archiconda3/envs/chatsql/lib/python3.8/site-packages/urllib3/connection.py", line 783, in ssl_wrap_socket_and_match_hostname
ssl_sock = ssl_wrap_socket(
File "/home/zhanghui/archiconda3/envs/chatsql/lib/python3.8/site-packages/urllib3/util/ssl
.py", line 469, in ssl_wrap_socket
ssl_sock = ssl_wrap_socket_impl(sock, context, tls_in_tls, server_hostname)
File "/home/zhanghui/archiconda3/envs/chatsql/lib/python3.8/site-packages/urllib3/util/ssl
.py", line 513, in _ssl_wrap_socket_impl
return ssl_context.wrap_socket(sock, server_hostname=server_hostname)
File "/home/zhanghui/archiconda3/envs/chatsql/lib/python3.8/ssl.py", line 500, in wrap_socket
return self.sslsocket_class._create(
File "/home/zhanghui/archiconda3/envs/chatsql/lib/python3.8/ssl.py", line 1040, in _create
self.do_handshake()
File "/home/zhanghui/archiconda3/envs/chatsql/lib/python3.8/ssl.py", line 1309, in do_handshake
self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: Hostname mismatch, certificate is not valid for 'huggingface.co'. (_ssl.c:1131)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/zhanghui/archiconda3/envs/chatsql/lib/python3.8/site-packages/urllib3/connectionpool.py", line 790, in urlopen
response = self._make_request(
File "/home/zhanghui/archiconda3/envs/chatsql/lib/python3.8/site-packages/urllib3/connectionpool.py", line 491, in _make_request
raise new_e
urllib3.exceptions.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: Hostname mismatch, certificate is not valid for 'huggingface.co'. (_ssl.c:1131)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/home/zhanghui/archiconda3/envs/chatsql/lib/python3.8/site-packages/requests/adapters.py", line 486, in send
resp = conn.urlopen(
File "/home/zhanghui/archiconda3/envs/chatsql/lib/python3.8/site-packages/urllib3/connectionpool.py", line 844, in urlopen
retries = retries.increment(
File "/home/zhanghui/archiconda3/envs/chatsql/lib/python3.8/site-packages/urllib3/util/retry.py", line 515, in increment
raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type]
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='huggingface.co', port=443): Max retries exceeded with url: /api/models/sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2 (Caused by SSLError(SSLCertVerificationError(1, "[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: Hostname mismatch, certificate is not valid for 'huggingface.co'. (_ssl.c:1131)")))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "main_gui.py", line 15, in
from utils import obtain_sql, retrieval_related_table, execute_sql
File "/home1/zhanghui/ChatSQL/utils.py", line 8, in
from prompt import embedder, corpus_embeddings, table_schema, corpus, In_context_prompt
File "/home1/zhanghui/ChatSQL/prompt.py", line 9, in
embedder = SentenceTransformer('paraphrase-multilingual-MiniLM-L12-v2')
File "/home/zhanghui/archiconda3/envs/chatsql/lib/python3.8/site-packages/sentence_transformers/SentenceTransformer.py", line 87, in init
snapshot_download(model_name_or_path,
File "/home/zhanghui/archiconda3/envs/chatsql/lib/python3.8/site-packages/sentence_transformers/util.py", line 442, in snapshot_download
model_info = _api.model_info(repo_id=repo_id, revision=revision, token=token)
File "/home/zhanghui/.local/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn
return fn(*args, **kwargs)
File "/home/zhanghui/.local/lib/python3.8/site-packages/huggingface_hub/hf_api.py", line 1675, in model_info
r = get_session().get(path, headers=headers, timeout=timeout, params=params)
File "/home/zhanghui/archiconda3/envs/chatsql/lib/python3.8/site-packages/requests/sessions.py", line 602, in get
return self.request("GET", url, **kwargs)
File "/home/zhanghui/archiconda3/envs/chatsql/lib/python3.8/site-packages/requests/sessions.py", line 589, in request
resp = self.send(prep, **send_kwargs)
File "/home/zhanghui/archiconda3/envs/chatsql/lib/python3.8/site-packages/requests/sessions.py", line 703, in send
r = adapter.send(request, **kwargs)
File "/home/zhanghui/archiconda3/envs/chatsql/lib/python3.8/site-packages/requests/adapters.py", line 517, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='huggingface.co', port=443): Max retries exceeded with url: /api/models/sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2 (Caused by SSLError(SSLCertVerificationError(1, "[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: Hostname mismatch, certificate is not valid for 'huggingface.co'. (_ssl.c:1131)")))
(chatsql) zhanghui@ubuntu:/home1/zhanghui/ChatSQL$

能不能做成离线版本,不用连HF的?

@yysirs
Copy link
Member

yysirs commented Oct 8, 2023

需要科学上网才行

@zhanghui-china
Copy link
Author

已经科学上网了。但是还是不行。。请教下这块能不能离线部署个大模型,然后让ChatSQL连接这个大模型呢?

@zhanghui-china
Copy link
Author

哦,sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2 这个模型我下载到本地试试。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants