Open Romanzhang2024 opened 11 months ago
Hi,
--anthropic_key
is the path to the file that stores the API key;--enable_search
in the command, then it will not ask you to provide the key. 1、Command-line Parameter:--anthropic_key "example/anthropic_key" is definitely the path to the file that stores the API key。"./example/anthropic_key" is a file that stores the API key that I've already applied on the side"https://app.nightfall.ai/developer-platform/api-keys"; Please look at the corresponding error log above carefully,Thanks。 2、RefChecker Demo:I have removed --enable_search in the command。The new command is “streamlit run demo/main.py --server.port=8588 -- --extractor=claude2 --checker=claude2”。 I got the following error log,i donot know how to Solve this problem(In China, I can't access hugging face):
File "/root/RefChecker-main/demo/main.py", line 77, in init self.model = AutoModelForSequenceClassification.from_pretrained( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/anaconda3/lib/python3.11/site-packages/transformers/models/auto/auto_factory.py", line 526, in from_pretrained config, kwargs = AutoConfig.from_pretrained( ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/anaconda3/lib/python3.11/site-packages/transformers/models/auto/configuration_auto.py", line 1082, in from_pretrained config_dict, unused_kwargs = PretrainedConfig.get_config_dict(pretrained_model_name_or_path, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/anaconda3/lib/python3.11/site-packages/transformers/configuration_utils.py", line 644, in get_config_dict config_dict, kwargs = cls._get_config_dict(pretrained_model_name_or_path, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/anaconda3/lib/python3.11/site-packages/transformers/configuration_utils.py", line 699, in _get_config_dict resolved_config_file = cached_file( ^^^^^^^^^^^^ File "/root/anaconda3/lib/python3.11/site-packages/transformers/utils/hub.py", line 429, in cached_file raise EnvironmentError( OSError: We couldn't connect to 'https://huggingface.co' to load this file, couldn't find it in the cached files and it looks like princeton-nlp/sup-simcse-roberta-large is not the path to a directory containing a file named config.json. Checkout your internet connection or see how to run the library in offline mode at 'https://huggingface.co/docs/transformers/installation#offline-mode'.
I see, for the first issue, I don't know the exact reason why Anthropic banned your API key, does it work in your other applications?
For the second issue, I think this is due to the limited access of Huggingface in China. The demo is using a SimCSE model for source attribution. Maybe you can first try to use a VPN for a quick fix. We will apply Modelscope to support users in China.
First,thanks for your reply! 1、The following description “How to Use an Anthropic Claude API Key” is from www.nightfall.ai To use an Anthropic Claude API key, you must include it in the HTTP header of all requests to the Anthropic Claude API. The header should be named "Authorization" and the value should be "Bearer " followed by your API key.
Now ,I haven't tried other apps yet to use the anthropic_key. 2、 According to "Your webside demo is using a SimCSE model for source attribution. Maybe you can first try to use a VPN for a quick fix. ", I would like to know how to use "SimCSE model for source attribution" and How to use VPN to access hugging face in linux environment? Could you provide further guidance info? Thank you!
when do you apply Modelscope to support users in China?
The following errors and exceptions occur when running RefChecker (Command-line:refchecker-cli),Please help to find out the reason, thank you。 errors and exceptions:
(base) root@Ubuntu18:~/RefChecker-main# refchecker-cli extract --input_path example/example_in.json --output_path example/example_out_triplets.json --extractor_name mixtral request.method: HEAD url: /mistralai/Mixtral-8x7B-Instruct-v0.1/resolve/main/config.json request.body: None self.max_retries: Retry(total=0, connect=None, read=False, redirect=None, status=None) Traceback (most recent call last): File "/root/anaconda3/lib/python3.11/site-packages/urllib3/connectionpool.py", line 468, in _make_request self._validate_conn(conn) File "/root/anaconda3/lib/python3.11/site-packages/urllib3/connectionpool.py", line 1097, in _validate_conn conn.connect() File "/root/anaconda3/lib/python3.11/site-packages/urllib3/connection.py", line 642, in connect sock_and_verified = _ssl_wrap_socket_and_match_hostname( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/anaconda3/lib/python3.11/site-packages/urllib3/connection.py", line 783, in _ssl_wrap_socket_and_match_hostname ssl_sock = ssl_wrapsocket( ^^^^^^^^^^^^^^^^ File "/root/anaconda3/lib/python3.11/site-packages/urllib3/util/ssl.py", line 471, in ssl_wrap_socket ssl_sock = _ssl_wrap_socket_impl(sock, context, tls_in_tls, serverhostname) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/anaconda3/lib/python3.11/site-packages/urllib3/util/ssl.py", line 515, in _ssl_wrap_socket_impl return ssl_context.wrap_socket(sock, server_hostname=server_hostname) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/anaconda3/lib/python3.11/ssl.py", line 517, in wrap_socket return self.sslsocket_class._create( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/anaconda3/lib/python3.11/ssl.py", line 1108, in _create self.do_handshake() File "/root/anaconda3/lib/python3.11/ssl.py", line 1379, in do_handshake self._sslobj.do_handshake() ssl.SSLEOFError: [SSL: UNEXPECTED_EOF_WHILE_READING] EOF occurred in violation of protocol (_ssl.c:1006)
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/root/anaconda3/lib/python3.11/site-packages/urllib3/connectionpool.py", line 791, in urlopen response = self._make_request( ^^^^^^^^^^^^^^^^^^^ File "/root/anaconda3/lib/python3.11/site-packages/urllib3/connectionpool.py", line 492, in _make_request raise new_e urllib3.exceptions.SSLError: [SSL: UNEXPECTED_EOF_WHILE_READING] EOF occurred in violation of protocol (_ssl.c:1006)
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "/root/anaconda3/lib/python3.11/site-packages/requests/adapters.py", line 490, in send resp = conn.urlopen( ^^^^^^^^^^^^^ File "/root/anaconda3/lib/python3.11/site-packages/urllib3/connectionpool.py", line 845, in urlopen retries = retries.increment( ^^^^^^^^^^^^^^^^^^ File "/root/anaconda3/lib/python3.11/site-packages/urllib3/util/retry.py", line 515, in increment raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ urllib3.exceptions.MaxRetryError: SOCKSHTTPSConnectionPool(host='huggingface.co', port=443): Max retries exceeded with url: /mistralai/Mixtral-8x7B-Instruct-v0.1/resolve/main/config.json (Caused by SSLError(SSLEOFError(8, '[SSL: UNEXPECTED_EOF_WHILE_READING] EOF occurred in violation of protocol (_ssl.c:1006)')))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/root/anaconda3/bin/refchecker-cli", line 8, in
Please help solve the problems above , thank you
Hi @Romanzhang2024 , this error is due to the access issue of HuggingFace. You can try the mirror site of HF: https://hf-mirror.com/ . Specifically, before running your code, execute the following command if you are using Linux:
export HF_ENDPOINT=https://hf-mirror.com
You can find more details in https://hf-mirror.com/
First,Thanks for your reply. After setting the environment variable of the mirror address("export HF_ENDPOINT=https://hf-mirror.com"), the following new problem occurred during the execution of the program. Please answer it,thanks.
new problem:
(base) root@Ubuntu18:~/RefChecker-main/etc# refchecker-cli extract --input_path example/example_in.json --output_path example/example_out_triplets.json --extractor_name mistral
request.method: HEAD
url: /dongyru/Mistral-7B-Claim-Extractor/resolve/main/config.json
request.body: None
self.max_retries: Retry(total=0, connect=None, read=False, redirect=None, status=None)
Traceback (most recent call last):
File "/root/anaconda3/bin/refchecker-cli", line 8, in
Hi @Romanzhang2024 , I cannot reproduce this error, could provide more information about your server (e.g. number of GPUs) you are using?
At present, my test server does not have GPUs.Is this problem caused by the test server does not have any GPUs? I will change a test server with some GPUs recently。
At present, my new test server contains 2 GPUs (NVIDIA A800)。 New issues following(checker_name alignscore):
root@test-SYS-420GP-TNR:~/RefChecker# refchecker-cli check --input_path example/example_out_triplets.json --output_path example/example_out.json --checker_name alignscore --aggregator_name soft
/root/miniconda3/lib/python3.11/site-packages/pydantic/_internal/_fields.py:151: UserWarning: Field "model_serverurl" has conflict with protected namespace "model".
You may be able to resolve this warning by setting model_config['protected_namespaces'] = ()
.
warnings.warn(
/root/miniconda3/lib/python3.11/site-packages/pydantic/_internal/_config.py:322: UserWarning: Valid config keys have changed in V2:
1、a command-line interface to run RefChecker in a console:
refchecker-cli extract \ --input_path example/example_in.json \ --output_path example/example_out_triplets.json \ --extractor_name claude2 \ --extractor_max_new_tokens 1000 \ --anthropic_key "example/anthropic_key" #I've already applied the ANTHROPIC_API_KEY on the side"https://app.nightfall.ai/developer-platform/api-keys";
print the following error log,i donot know how to Solve this problem: anthropic.PermissionDeniedError: Error code: 403 - {'error': {'type': 'forbidden', 'message': 'Request not allowed'}} 2、RefChecker Demo I used the webside RefChecker Demo and got the following error:
Traceback (most recent call last): File "/root/anaconda3/lib/python3.11/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 534, in _run_script exec(code, module.dict) File "/root/RefChecker-main/demo/main.py", line 48, in
assert os.environ.get('SERPER_API_KEY')
AssertionError
In China, I can't access google, and I don't have SERPER_API_KEY. I want to use the domestic search engine or no search engine (similar to refchecker-cli command-line usage, The input json file contains reference content)。
I want to know whether you have any good suggestions (eg:how to modify the python code) to quickly use the webside RefChecker Demo to test some examples.