Sure, you can modify the code to keep the original file extension by using the os.path.splitext function. Here's the updated code:
``` 
import os

path = '/path/to/folder'
files = os.listdir(path)

for index, file in enumerate(files):
    file_name, file_ext = os.path.splitext(file)
    os.rename(os.path.join(path, file), os.path.join(path, ''.join([str(index + 1), file_ext])))
``` 
This code uses the os.path.splitext function to split the file name and its extension. The file_name variable stores the file name without the extension, while file_ext stores the file extension including the period. The code then appends the index value to the file name and adds the original file extension to the end, resulting in a new file name with the same extension as the original file.
spam fails_task lang_mismatch pii not_appropriate hate_speech sexual_content quality toxicity humor helpfulness creativity violence