Spaces:
Runtime error
Runtime error
Aleksandr Maiorov
commited on
Commit
·
484c62c
1
Parent(s):
7ba9eb3
v 0.1
Browse files- правка формата ответа
app.py
CHANGED
@@ -54,13 +54,13 @@ llm = LlamaCPP(
|
|
54 |
verbose=True,
|
55 |
)
|
56 |
|
57 |
-
def generate_response(
|
58 |
try:
|
59 |
# Обработка текстового сообщения
|
60 |
logger.info('Output:')
|
61 |
-
logger.info(
|
62 |
|
63 |
-
response =
|
64 |
|
65 |
# Отправка ответа
|
66 |
if response:
|
@@ -87,5 +87,5 @@ async def predict(text: str):
|
|
87 |
# Генерация ответа с помощью модели
|
88 |
logger.info('post/predict')
|
89 |
response = llm.complete(text)
|
90 |
-
text = generate_response(response)
|
91 |
return {"response": text}
|
|
|
54 |
verbose=True,
|
55 |
)
|
56 |
|
57 |
+
def generate_response(prompt):
|
58 |
try:
|
59 |
# Обработка текстового сообщения
|
60 |
logger.info('Output:')
|
61 |
+
logger.info(prompt)
|
62 |
|
63 |
+
response = prompt['choices'][0]['text']
|
64 |
|
65 |
# Отправка ответа
|
66 |
if response:
|
|
|
87 |
# Генерация ответа с помощью модели
|
88 |
logger.info('post/predict')
|
89 |
response = llm.complete(text)
|
90 |
+
text = generate_response(prompt=response)
|
91 |
return {"response": text}
|