I keep receiving 503 error when using HuggingFaceEndpoint to access the model
Here're my codes:
import os
import warnings
from urllib3.exceptions import NotOpenSSLWarning
from langchain_huggingface import HuggingFaceEndpoint
import sys
warnings.filterwarnings("ignore", category=NotOpenSSLWarning)
os.environ["HUGGINGFACEHUB_API_TOKEN"] = '....'
llm = HuggingFaceEndpoint(
repo_id="meta-llama/Llama-3.2-3B-Instruct",
timeout=60
)
def explain_code(code):
base_prompt = """
Tell me about the flower
"""
prompt = base_prompt + code
completion = llm.invoke(prompt)
return completion
if name == "main":
code = """rose"""
result = explain_code(code)
print(result)
But I got the error as follows:
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 503 Server Error: Service Temporarily Unavailable for url: /static-proxy?url=https%3A%2F%2Frouter.huggingface.co%2Fhf-inference%2Fmodels%2Fmeta-llama%2FLlama-3.2-3B-Instruct%3C%2Fa%3E%3C%2Fp%3E
Please could someone tell me how to fix the problem?
Thanks!!!
me too
Please could someone tell me how to fix it? Or is there any available Llama model that I can replace with? I'm struggling under a deadline...
Please could someone tell me how to fix it? Or is there any available Llama model that I can replace with? I'm struggling under a deadline...
Just change to:client = InferenceClient("meta-llama/Llama-3.1-8B-Instruct")