Skip to content

Commit

Permalink
added readme
Browse files Browse the repository at this point in the history
  • Loading branch information
vivek-athina committed Feb 23, 2024
1 parent 068cf3a commit 4bbb697
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 5 deletions.
28 changes: 27 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,29 @@
# CI using Athina Evals

This repository demonstrates on how you can do a CI configuration for your RAG application using Athina Evals.
This repository demonstrates on how you can do a CI configuration for your RAG application using Athina Evals.

## Rag Application

A sample Rag application is provided in the `src` directory. This is a simple rag application built using llama_index. We are going add evaluations for this application using Athina Evals.

## Setting up the dependencies

Install the necessary dependencies by running the following command:

```bash
pip install -r requirements.txt
```

additionally you need to install the `athina-evals` package by running the following command:

```bash
pip install athina-evals
```

## Running the evaluation script

Then you can run the evaluation script by running the following command:

```bash
python -m evaluations/run_athina_evals.py
```
2 changes: 1 addition & 1 deletion evaluations/golden_dataset.jsonl
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
{"query": "How has Y Combinator's alumni network impacted new entrepreneurs?", "expected_response": "Y Combinator's vast network of alumni and mentors provides ongoing support, advice, and networking opportunities to new entrepreneurs, significantly impacting their success and growth."}
{"query": "What qualities does Y Combinator look for in the founding team of a startup?", "expected_response": "Y Combinator looks for qualities such as strength, cohesiveness, and the ability to execute rapidly in the founding team of a startup."}
{"query": "What factors about a startup's product or service are important to Y Combinator?", "expected_response": "The novelty, market potential, and the problem it solves are important factors about a startup's product or service to Y Combinator."}
{"query": "What does Y Combinator consider when evaluating the scalability of a business model?", "expected_response": "When evaluating scalability, Y Combinator considers whether the business model allows for rapid growth and expansion in the market."}
{"query": "What does Y Combinator consider when evaluating the scalability of a business model?", "expected_response": "When evaluating scalability, Y Combinator considers whether the business model allows for rapid growth and expansion in the market."}
18 changes: 15 additions & 3 deletions evaluations/run_athina_evals.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,21 @@ def load_data():
"expected_response": "Y Combinator takes a 7% equity stake in companies in return for $125,000 on a post-money SAFE, and a 1.5% equity stake in companies participating in the YC Fellowship Program in exchange for a $20,000 investment.",
}
]

for item in raw_data:
item['context'], item['response'] = app.generate_response(item['query'])

# # or read from file
# with open('evaluations/golden_dataset.jsonl', 'r') as file:
# raw_data = file.read()
# raw_data = raw_data.split('\n')
# data = []
# for item in raw_data:
# item = json.loads(item)
# item['context'], item['response'] = app.generate_response(item['query'])
# data.append(item)
# global dataset
# dataset = RagLoader().load_dict(data)
# pd.DataFrame(dataset)
# for item in raw_data:
# item['context'], item['response'] = app.generate_response(item['query'])

global dataset
dataset = RagLoader().load_dict(raw_data)
Expand Down

0 comments on commit 4bbb697

Please sign in to comment.