Run this model with HF Jobs

Run codellama/CodeLlama-70b-hf on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs and TRL to fine-tune https://huggingface.co/codellama/CodeLlama-70b-hf. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/codellama/CodeLlama-70b-hf on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.

Evaluate on a benchmark

Use HF Jobs to evaluate https://huggingface.co/codellama/CodeLlama-70b-hf. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.

Quantize for lower memory use

Use HF Jobs to create a 4-bit version of https://huggingface.co/codellama/CodeLlama-70b-hf. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.

How do I resolve this issue?

#11
by anshumankmr - opened
Input validation error: inputs tokens + max_new_tokens must be <= 1512. Given: 9959 inputs tokens and 512 max_new_tokens

Code

llm = HuggingFaceEndpoint(
    endpoint_url=f"{your_endpoint_url}",
    max_new_tokens=512,
    top_k=10,
    top_p=0.1,
    typical_p=0.95,
    temperature=0.01,
    repetition_penalty=1.03,
)
db_chain = create_sql_query_chain(llm=llm, db=db)
user_query = "<BLAH BLAH>"
context = """
"""
prompt = f"""Please that your job is to write an SQL query to extract this data from a Postgres database and not to actually create visualizations.The visualization creation will be done later.Given an input question, first create a syntactically correct PostgreSQL query to run. DO NOT include any extra content.
Info About Dataset {context}
            Use the following format:
            Question: "Question here"
            SQL Query to run
            Question: {user_query}"""
def find_sql_queries(text):
    # Regex pattern to match basic SQL queries
    words_to_remove = ["SQLQuery:", "sql"]
    for word_to_remove in words_to_remove:
        text = text.replace(word_to_remove, "")
    text = text[text.find("SELECT"): text.find(";")]
    return text

result = find_sql_queries(db_chain.invoke({"question": prompt}))
print(result)

I deployed codellama 70B model

You should look at what db_chain.invoke({"question": prompt}) is doing. You will see somewhere in there that it is generating a very large value for inputs and sending it to HuggingFace (HuggingFace is your llm variable).

Sign up or log in to comment