Spaces:
Sleeping
Sleeping
Update interaction.py
Browse files- interaction.py +4 -3
interaction.py
CHANGED
|
@@ -15,11 +15,12 @@ def init_pipeline():
|
|
| 15 |
return pipeline
|
| 16 |
|
| 17 |
def generate_response(question, pipeline):
|
| 18 |
-
|
| 19 |
-
'retriever':{
|
| 20 |
'prompt_builder':{'question':question}
|
| 21 |
})
|
| 22 |
-
|
|
|
|
| 23 |
|
| 24 |
def audio_response(response):
|
| 25 |
audio_stream="response_audio.mp3"
|
|
|
|
| 15 |
return pipeline
|
| 16 |
|
| 17 |
def generate_response(question, pipeline):
|
| 18 |
+
response = pipeline.run({
|
| 19 |
+
'retriever':{'query':question},
|
| 20 |
'prompt_builder':{'question':question}
|
| 21 |
})
|
| 22 |
+
response = response['llm']['replies'][0]
|
| 23 |
+
return response
|
| 24 |
|
| 25 |
def audio_response(response):
|
| 26 |
audio_stream="response_audio.mp3"
|