Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
ddlBoJack committed Jan 15, 2024
1 parent 248f86e commit 899352c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/llama_recipes/datasets/speech_dataset_inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def __init__(self,

# self.data_list = contents
self.IGNORE_INDEX = -100 # The default setting in CrossEntropyLoss
self.prompt_template = "{}"
self.prompt_template = "USER: {}\n ASSISTANT:"
self.fix_length_audio = dataset_config.fix_length_audio

self.data_list = []
Expand Down Expand Up @@ -72,7 +72,7 @@ def __getitem__(self, index):
# audio_raw = np.concatenate((np.zeros(random.randint(0, 16000)), audio_raw, np.zeros(random.randint(0, 16000)))).astype(audio_raw.dtype)[:16000*30]
audio_mel = whisper.log_mel_spectrogram(audio_raw).permute(1, 0)

prompt = ""
prompt = "Transcribe speech to text. Output the transcription directly without redundant content. Ensure that the output is not duplicated. "

prompt = self.prompt_template.format(prompt)
prompt_ids = self.tokenizer.encode(prompt)
Expand Down

0 comments on commit 899352c

Please sign in to comment.