Spaces:
Runtime error
Runtime error
Changed base prompt for Qwen
Browse files- utils/speech_recognition.py +0 -2
- utils/text_processing.py +1 -1
utils/speech_recognition.py
CHANGED
|
@@ -6,8 +6,6 @@ def transcribe_audio(audio_path):
|
|
| 6 |
device = "cpu"
|
| 7 |
if torch.cuda.is_available():
|
| 8 |
device = "cuda"
|
| 9 |
-
if torch.mps.is_available():
|
| 10 |
-
device = "mps"
|
| 11 |
|
| 12 |
pipe = pipeline(
|
| 13 |
"automatic-speech-recognition",
|
|
|
|
| 6 |
device = "cpu"
|
| 7 |
if torch.cuda.is_available():
|
| 8 |
device = "cuda"
|
|
|
|
|
|
|
| 9 |
|
| 10 |
pipe = pipeline(
|
| 11 |
"automatic-speech-recognition",
|
utils/text_processing.py
CHANGED
|
@@ -16,7 +16,7 @@ def generate_response(model, tokenizer, question, context):
|
|
| 16 |
prompt = f"Контекст: {context}\n\nВопрос: {question}\nОтвет:"
|
| 17 |
|
| 18 |
messages = [
|
| 19 |
-
{"role": "system", "content": "Вы - полезный помощник
|
| 20 |
{"role": "user", "content": prompt}
|
| 21 |
]
|
| 22 |
|
|
|
|
| 16 |
prompt = f"Контекст: {context}\n\nВопрос: {question}\nОтвет:"
|
| 17 |
|
| 18 |
messages = [
|
| 19 |
+
{"role": "system", "content": "Вы - полезный помощник."},
|
| 20 |
{"role": "user", "content": prompt}
|
| 21 |
]
|
| 22 |
|