LoslegenKostenlos loslegen

Generating creative copy

You're developing an AI-powered content assistant for a SaaS marketing team. The team needs to automate social media posts about their latest software updates, and you need to adjust response diversity so that multiple calls to the model result in different variations.

You have been provided the Llama class instance in the llm variable and the code to call the completion. You are also given a sample prompt to test with.

Diese Übung ist Teil des Kurses

Working with Llama 3

Kurs anzeigen

Anleitung zur Übung

  • Adjust the top-p parameter to a value in the upper half of its range so that it generates more varied responses.

Interaktive Übung

Vervollständige den Beispielcode, um diese Übung erfolgreich abzuschließen.

output = llm(
      	"Write a tweet announcing a new analytics dashboard feature for enterprise users.", 
		max_tokens=15,
		# Set top-p to a value in the upper range for more varied responses
		top_p=____
	) 

print(output['choices'][0]['text'])
Code bearbeiten und ausführen