Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion ragia/01_ingest.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,15 @@

chunker = HybridChunker(
tokenizer=AutoTokenizer.from_pretrained(DENSE_MODEL),
max_tokens=450,
max_tokens=300,
)

dense_model = TextEmbedding(DENSE_MODEL)
sparse_model = SparseTextEmbedding(SPARSE_MODEL)
colbert_model = LateInteractionTextEmbedding(COLBERT_MODEL)

# %%

def doc_to_vectordb(path):

doc = doc_convert.convert(path)
Expand Down
6 changes: 3 additions & 3 deletions ragia/03_train.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
random_state=42,
stratify=y,
)

print("Treino Resposta", np.mean(y_train) )
print("Teste Resposta", np.mean(y_test) )

Expand All @@ -54,7 +54,7 @@
with mlflow.start_run():

clf = ensemble.RandomForestClassifier(
n_estimators=100,
n_estimators=500,
min_samples_leaf=3,
random_state=42,
)
Comment on lines 56 to 60
Expand Down Expand Up @@ -86,5 +86,5 @@

# %%

print(np.mean(y))
print(np.mean(y_train))
# %%
8 changes: 4 additions & 4 deletions ragia/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,15 @@ def predict():
},
query = colbert_query,
using="colbert",
limit=4,
limit=5,
)

context = "\n".join([f'- {r.payload["text"]}\n' for r in results.points])

prompt = f"""
Você é um assistente de chato do streamer, live coder, estatístico e especialista em dados, Téo Calvo (canal TéoMeWhy).
Você é um assistente de chat do streamer, live coder, estatístico e especialista em dados, Téo Calvo (canal TéoMeWhy).

Responda a pergunta abaixo usando contexto com os documentos encontrados sobre o projeto Téo Me Why.
Responda a pergunta abaixo usando contexto com os documentos encontrados sobre o projeto Téo Me Why e carreira na área de dados e tecnologia.

Pergunta: {query}

Expand All @@ -106,7 +106,7 @@ def predict():

---

Sumarize o contexto e responda de forma clara, objetiva e descontraída com no máximo 300 caracteres.
Sumarize a resposta com o contexto e responda de forma clara, objetiva e descontraída com no máximo 300 caracteres. Lembre-se que se trata de uma live aberta.

Caso em sua resposta, haja link para nossa plataforma, considere este: cursos.teomewhy.org

Expand Down