Skip to content

Instantly share code, notes, and snippets.

@ljnmedium
ljnmedium / ljn_scores_comparison.md
Created March 22, 2024 09:45
LJN agent scores compared to competitors
Competitors Total simulation time Max. decision time 99% decision time 95% decision time
Competitor #1 26874 494.31 0.18 0.08
Competitor #2 33665 105.85 0.94 0.14
La Javaness 24027 11.15 2.60 0.08
@ljnmedium
ljnmedium / agent_results.md
Created March 22, 2024 09:40
results table
Track Ep. score Op. score Nres. score Assist score Completed scenarii
Local dataset 65.01 65.05 86.67 51.93 159/208 (76.4%)
Main assistant 60.83 59.44 90.14 46.55 140/208 (67.3%)
Sim2Real 59.65 55.21 77.41 - 141/208 (67.7%)
@ljnmedium
ljnmedium / table01.md
Created March 21, 2024 08:43
description of the grid2op environment
Element Function Possible action
Generator Produces electricity, injects power in the grid. Different types: non-renewable/renewable Redispatch (non-renewable), curtailment (renewable)
Load Consumes electricity, consumption endpoint of the grid
Substation Nodes of the power grid, interconnect elements through 2 connexion buses Reconfigure buses
Power line Responsible for transporting electricity, connects 2 elements of the grid Connect/disconnect
Storage Battery able to store energy, making it act conceptually as both generator and load within the system Charge/Discharge
@ljnmedium
ljnmedium / model_inforetrieval.py
Created September 29, 2023 07:39
model_inforetrieval.py
chatdoc = ChatDoc(model_name= OPENAI_MODEL)
chatdoc.connect_openai_api()
questions = QUESTIONS_COMMITTE_AUDIT
retriever.retreive_with_query( query, top_k=1, namespace='Eiffage')
contexts = loader_document.retreive_contents_from_ids(ids)
respone = chatdoc.prompt_with_context(query, contexts= list(contexts.values()), verbose=True)
print(query,'\n', respone, '\n')
@ljnmedium
ljnmedium / example.log
Created September 29, 2023 07:38
example.log
[09/Sep/2023 15:13:19] INFO - Answer the question based on the context below.
Context:
262RepoR t by the boaRd of diRectoR s on coRpoR ate goveRnance
The following table shows the situation of the non-independent directors with regard to the independence criteria:
Independence criteriaBenoît
de RuffrayLaurent ....
Question: Find the answers for the questions:
1/ what is the number of meetings of Audit Committee ?
2/ what is the average attendance rate (%) of meetings of Audit Committe ?
3/ what is the number of participates in the Audit Committe ?
@ljnmedium
ljnmedium / example_upload_data.py
Created September 29, 2023 07:37
example_upload_data.py
data = [
{'content': 'This universal registration document, eco-designed from start to finish for the second year, captures the essence \nof what makes Eiffage different and embodies its vision and commitments to advancing the environmental transition.\nUNIVERSAL REGISTRATION DOCUMENT 2021Advancing the environmental transition \nand fulfilling our social responsibility',
'metadata': {'source': 'Universal Registration Document/10_EIFFAGE_URD2021_VA.pdf',
'page': 0,
'id': 0}},
{'content': '01In your hands you have a document designed \nusing a low-carbon approach for the second \nyear in a row. Its plain and simple content, \nthe\xa0typefaces selected, the visuals, colours, \nprinting techniques and distribution methods… \nAll these decisions help to\xa0make this annual \nreport a resource-efficient, low-impact \nproduct. \nEvery year, we refine our approach using \nthe\xa0lessons we learned from our previous \nexperience, as all the Group’s teams do. \nWe\xa0continue to work hard to devise and \ni
@ljnmedium
ljnmedium / chat_doc.py
Created September 29, 2023 07:36
chat_doc.py
OPENAI_MODEL ='text-davinci-003'
class ChatDoc():
def __init__(self, model_name:str = OPENAI_MODEL, **model_params):
self.model = model_name
self.engine_params = dict(
model = model_name,
temperature=0,
max_tokens=400,
@ljnmedium
ljnmedium / refactoring_2.py
Created September 29, 2023 07:34
refactoring_2.py
from pinecone import Index
class Retreiver(Index):
def __init__(self, index_name, embedd_openai_model, sparse_model_file_name, dimension=1536, metric="dotproduct"):
self.index_name = index_name
# Create index
if index_name not in pinecone.list_indexes():
@ljnmedium
ljnmedium / refactoring_1.py
Created September 29, 2023 07:32
refactoring_1.py
from openai import Embedding
from pinecone_text.sparse import BM25Encoder
EMBEDDING_MODEL = "text-embedding-ada-002"
SPARSE_MODEL_FILE_NAME = "bm25_values.json"
class Embedding_Model(Embedding):
def __init__(self, model_name):
self.engine = model_name
@ljnmedium
ljnmedium / index_describe.py
Created September 29, 2023 07:30
index_describe.py
index.describe_index_stats()
# Return for example:
{
'dimension': 1536,
'index_fullness': 0.1,
'namespaces': {
'Eiffage': {'vector_count': 344},
'total_vector_count': 344
}