This commit is contained in:
parent
195c779088
commit
750683fb5c
@ -1,4 +1,5 @@
|
|||||||
import io
|
import io
|
||||||
|
import asyncio
|
||||||
import os
|
import os
|
||||||
import traceback
|
import traceback
|
||||||
|
|
||||||
@ -126,13 +127,18 @@ async def handle_document(update: Update, context: ContextTypes.DEFAULT_TYPE):
|
|||||||
customer_cv, _ = await CustomerCV.objects.aupdate_or_create(customer=customer, defaults=dict(
|
customer_cv, _ = await CustomerCV.objects.aupdate_or_create(customer=customer, defaults=dict(
|
||||||
content=resume,
|
content=resume,
|
||||||
))
|
))
|
||||||
features = batch_extract_features(customer_cv.content)[0]
|
|
||||||
add_vectors(
|
def upload_vectors():
|
||||||
"cvs",
|
features = batch_extract_features([customer_cv.content])[0]
|
||||||
customer_cv.id,
|
add_vectors(
|
||||||
embed_features(features.model_dump())[0],
|
"cvs",
|
||||||
{'content': customer_cv.content, 'features_json': features.model_dump()},
|
customer_cv.id,
|
||||||
)
|
features.model_dump(),
|
||||||
|
{'content': customer_cv.content, 'features_json': features.model_dump()},
|
||||||
|
embed_features(features.model_dump()),
|
||||||
|
)
|
||||||
|
|
||||||
|
await asyncio.to_thread(upload_vectors)
|
||||||
|
|
||||||
await context.bot.editMessageText("Отлично! Запомнил Ваше резюме.", update.effective_chat.id, message.id)
|
await context.bot.editMessageText("Отлично! Запомнил Ваше резюме.", update.effective_chat.id, message.id)
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user