File size: 272 Bytes
3df258d c0fd679 074927f 3df258d c0fd679 3df258d |
1 2 3 4 5 6 7 8 |
from transformers import pipeline, set_seed
summarizer = pipeline('text2text-generation', model='describeai/gemini-small')
code = "print('hello world!')"
response = summarizer(code, max_length=100, num_beams=3)
print("Summarized code: " + response[0]['generated_text'])
|