Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -58,8 +58,10 @@ def generate_response(transcription):
|
|
58 |
tokenized_chat = f'<|system|>\n{sys_prompt}{eos_token}<|user|>\n{transcription}{eos_token}<|assistant|>\n'
|
59 |
|
60 |
print(tokenized_chat)
|
|
|
|
|
61 |
|
62 |
-
input_ids = tokenized_chat[
|
63 |
if len(input_ids.shape) == 1:
|
64 |
input_ids = input_ids.unsqueeze(0)
|
65 |
with torch.no_grad():
|
|
|
58 |
tokenized_chat = f'<|system|>\n{sys_prompt}{eos_token}<|user|>\n{transcription}{eos_token}<|assistant|>\n'
|
59 |
|
60 |
print(tokenized_chat)
|
61 |
+
|
62 |
+
tokenized_chat = tokenizer(tokenized_chat)
|
63 |
|
64 |
+
input_ids = tokenized_chat['input_ids'].to(device)
|
65 |
if len(input_ids.shape) == 1:
|
66 |
input_ids = input_ids.unsqueeze(0)
|
67 |
with torch.no_grad():
|