from huggingfacehub import InferenceClient messages = [{"role": "user", "content": "What…
- User
from huggingface_hub import InferenceClient messages = [{"role": "user", "content": "What is the capital of France?"}] client = InferenceClient("meta-llama/Meta-Llama-3-8B-Instruct") client.chat_completion(messages, max_tokens=100). Tenemos el siguiente error: vscode ➜ /workspaces/Tensorflow $ python InferenceCli.py Traceback (most recent call last): File "/home/vscode/.local/lib/python3.11/site-packages/huggingface_hub/utils/_http.py", line 406, in hf_raise_for_status response.raise_for_status() File "/home/vscode/.local/lib/python3.11/site-packages/requests/models.py", line 1024, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://api-inference.huggingface.co/models/meta-llama/Meta-Llama-3-8B-Instruct/v1/chat/completions
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "/workspaces/Tensorflow/InferenceCli.py", line 4, in client.chat_completion(messages, max_tokens=100) File "/home/vscode/.local/lib/python3.11/site-packages/huggingface_hub/inference/_client.py", line 892, in chat_completion data = self.post(model=model_url, json=payload, stream=stream) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/vscode/.local/lib/python3.11/site-packages/huggingface_hub/inference/_client.py", line 306, in post hf_raise_for_status(response) File "/home/vscode/.local/lib/python3.11/site-packages/huggingface_hub/utils/_http.py", line 477, in hf_raise_for_status raise _format(HfHubHTTPError, str(e), response) from e huggingface_hub.errors.HfHubHTTPError: 404 Client Error: Not Found for url: https://api-inference.huggingface.co/models/meta-llama/Meta-Llama-3-8B-Instruct/v1/chat/completions (Request ID: Root=1-68658261-31a11e0b60ef307c29b34003;86d480d3-120f-4e2e-94f1-f389e1c5fcb5)
- Assistant
- User
Ayudame a buscar un modelo disponible que puedas usar para chat desde Huggingface
- Assistant
- User
Traceback (most recent call last): File "/home/vscode/.local/lib/python3.11/site-packages/huggingface_hub/utils/_http.py", line 406, in hf_raise_for_status response.raise_for_status() File "/home/vscode/.local/lib/python3.11/site-packages/requests/models.py", line 1024, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://api-inference.huggingface.co/models/mosaicml/mpt-7b-chat/v1/chat/completions
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "/workspaces/Tensorflow/InferenceCli.py", line 6, in response = client.chat_completion(messages, max_tokens=100) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/vscode/.local/lib/python3.11/site-packages/huggingface_hub/inference/_client.py", line 892, in chat_completion data = self.post(model=model_url, json=payload, stream=stream) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/vscode/.local/lib/python3.11/site-packages/huggingface_hub/inference/_client.py", line 306, in post hf_raise_for_status(response) File "/home/vscode/.local/lib/python3.11/site-packages/huggingface_hub/utils/_http.py", line 477, in hf_raise_for_status raise _format(HfHubHTTPError, str(e), response) from e huggingface_hub.errors.HfHubHTTPError: 404 Client Error: Not Found for url: (Request ID: Root=1-686587b3-35276cff4c3acb11137ba7b3;1333e704-ef18-4cd8-a845-6bdb3fa4b746)
- Assistant
- User
Traceback (most recent call last): File "/home/vscode/.local/lib/python3.11/site-packages/huggingface_hub/utils/_http.py", line 406, in hf_raise_for_status response.raise_for_status() File "/home/vscode/.local/lib/python3.11/site-packages/requests/models.py", line 1024, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://api-inference.huggingface.co/models/mosaicml/mpt-7b-chat
The above exception was the direct cause of the following exception:
- Assistant