replicate/replicate-python

Python API output return nothing

dongzizhu opened this issue · 1 comments

Hi,

I tried to use your python API for the llama 2 model. I run the example code, which is

output = replicate.run( "meta/llama-2-70b-chat:2d19859030ff705a87c746f7e96eea03aefb71f166725aee39692f1476566d48", input={ "debug": False, "top_p": 1, "prompt": "Can you write a poem about open source machine learning? Let's make it in the style of E. E. Cummings.", "temperature": 0.5, "system_prompt": "You are a helpful, respectful and honest assistant. Always answer as helpfully as possible, while being safe. Your answers should not include any harmful, unethical, racist, sexist, toxic, dangerous, or illegal content. Please ensure that your responses are socially unbiased and positive in nature.\n\nIf a question does not make any sense, or is not factually coherent, explain why instead of answering something not correct. If you don't know the answer to a question, please don't share false information.", "max_new_tokens": 500, "min_new_tokens": -1 } ) print(output)

Apparently the output is a

<generator object Prediction.output_iterator at 0x2aba5e23a970>.

I tried next(output), it returned an empty string. Could you tell what I am doing wrong? Thx!

the first item in the generator is an empty string. This is a stupid question ...