No output in sample python code
print("huggingface")

access_token = 'xxxxx'

from transformers import AutoTokenizer, AutoModelForCausalLM

tokenizer = AutoTokenizer.from_pretrained("google/gemma-7b", token = access_token)
model = AutoModelForCausalLM.from_pretrained("google/gemma-7b", token = access_token)

input_text = "Write me a poem about Machine Learning."
input_ids = tokenizer(input_text, return_tensors="pt")

outputs = model.generate(**input_ids)
print("outputs =", outputs)
print(tokenizer.decode(outputs[0]))There’s no output past “huggingface” - it just finishes off and returns back to the terminal.
2024-06-10T18:31:45Z
You can specify the amount of tokens to generate in using the max_new_tokens flag.model.generate(**input_ids, max_new_tokens = 100)
2024-06-11T06:32:08Z
This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.