Spaces:
Runtime error
Runtime error
import os | |
os.environ['REPLICATE_API_TOKEN'] = "r8_afc5kESy4ucPojF3Tw1GE25ER4Ovudy1iPVw6" | |
import replicate | |
# Prompts | |
pre_prompt = "You are a helpful assistant. You do not respond as 'User' or pretend to be 'User'. You only respond once as 'Assistant'." | |
prompt_input = "What is Hugging Face" | |
# Generate LLM response | |
output = replicate.run('huggingface/llama-base-125M', # LLM model | |
input={ | |
"prompt": f"{pre_prompt} {prompt_input} Assistant: ", # Prompts | |
"temperature": 0.1, | |
"top_p": 0.9, | |
"max_length": 124, | |
"repetition_penalty": 1 | |
}) # Model parameters | |
full_response = '' | |
for item in output: | |
full_response += item | |
print(full_response) |