CustomLLM / llama_index.py
llama_index.py
Raw
import os
os.environ['OPENAI_API_KEY'] = ""

from llama_index import GPTVectorStoreIndex, SimpleDirectoryReader

documents = SimpleDirectoryReader('cluster3').load_data()
index = GPTVectorStoreIndex.from_documents(documents)
queries = ["Should technical documentation also be written for non-technical people?", "Does the AIA stipulate that we need someone monitoring the AI-models full-time?",
"Does the AIA require me to work with encrypted data only?", "How should we deal with missing data according to the AIA?", "What other data risks besides data privacy should my organization be concerned with?"
, "What does the AIA mean by high-risk AI?", "Does the AIA require an external audit?", "Which documents should be included in the compliance documentation?"
, "Does the AIA mention metrics that should be used to determine a models risks for rights and discrimination?", "What does the AIA mean by ‘human oversight’?",
"To which extent does my ISO certification help towards AIA compliance?", "Does GDPR training also include data bias and model bias training?", "What are the biggest risks on AIA compliance when data is gathered in-house?",
"Our organizations users data from customers, what are some of the biggest risks when aiming for AIA compliance?", "We only use ChatGPT and other out of the box AI models, should we still be concerned with the AIA?",
"What can we do to improve AIA compliance concerning our technical documentation?", "We currently don’t communicate anything about our models with our users, how can we better communicate information with the users for AIA compliance?",
"Our organization is very small and no one is specialised in compliance, where do we even begin to achieve AIA compliance?",
"We currently have no idea if we communicate with our stakeholders according to the AIA, how should we assess this to make improvements?",
"The AIA stipulates that accuracy should be according to state of the art, this seems very vague, how should I go about achieving state of the art accuracy?"]

query_engine = index.as_query_engine()
for question in queries:
    query = question
    response = query_engine.query(query)
    print(query)
    print(response)