INNER CODE UNIT · Python
predict
CerebriumAI/examples · 1-getting-started/2-using-cerebrium-secrets/main.py:92
def predict(prompt, cutoff_len, temperature, top_p, top_k, num_beams, max_new_tokens):
item = Item(
prompt=prompt,
cutoff_len=cutoff_len,
temperature=temperature,
top_p=top_p,
top_k=top_k,
num_beams=num_beams,
max_new_tokens=max_new_tokens,
)
result = generate(params=item)
return {"Prediction": result}