Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to start fine-tuning a model using the OpenAI API.
Prompt Engineering / GenAI
response = openai.FineTune.create(training_file=[1]) Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Passing an integer instead of a string file ID.
Using a file upload function instead of the file ID.
Passing None or empty value.
✗ Incorrect
The training_file parameter requires the file ID string, such as 'file-abc123'.
2fill in blank
mediumComplete the code to list all fine-tune jobs using the OpenAI API.
Prompt Engineering / GenAI
fine_tunes = openai.FineTune.[1]() Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using create() instead of list().
Using retrieve() which requires a job ID.
Using delete() which removes a job.
✗ Incorrect
The list() method returns all fine-tune jobs.
3fill in blank
hardFix the error in the code to retrieve a fine-tune job by ID.
Prompt Engineering / GenAI
job = openai.FineTune.[1](id='ft-A1B2C3')
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using list() which returns all jobs, not one.
Using create() which starts a new job.
Using update() which modifies a job.
✗ Incorrect
The retrieve() method fetches a fine-tune job by its ID.
4fill in blank
hardFill both blanks to create a fine-tune job with a validation file.
Prompt Engineering / GenAI
response = openai.FineTune.create(training_file=[1], [2]=validation_file)
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect parameter names like 'validation_file_name'.
Passing the wrong variable or literal for the training file.
✗ Incorrect
The training_file parameter requires the file ID string like 'file-train123'. The parameter name for the validation file is 'validation_file', assuming `validation_file` is a variable holding the validation file ID.
5fill in blank
hardFill all three blanks to create a fine-tune job with training file, validation file, and model name.
Prompt Engineering / GenAI
response = openai.FineTune.create(training_file=[1], validation_file=[2], model=[3])
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up parameter names and values.
Using incorrect strings for file IDs or model names.
Forgetting to specify the base model.
✗ Incorrect
The training_file is the file ID 'file-xyz789', the validation_file uses variable 'validation_file' (holding its ID), and model is the string 'curie'.