This commit is contained in:
parent
195c779088
commit
750683fb5c
@ -1,4 +1,5 @@
|
||||
import io
|
||||
import asyncio
|
||||
import os
|
||||
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(
|
||||
content=resume,
|
||||
))
|
||||
features = batch_extract_features(customer_cv.content)[0]
|
||||
add_vectors(
|
||||
"cvs",
|
||||
customer_cv.id,
|
||||
embed_features(features.model_dump())[0],
|
||||
{'content': customer_cv.content, 'features_json': features.model_dump()},
|
||||
)
|
||||
|
||||
def upload_vectors():
|
||||
features = batch_extract_features([customer_cv.content])[0]
|
||||
add_vectors(
|
||||
"cvs",
|
||||
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)
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user