Skip to content
Snippets Groups Projects
Commit 1f34e2a1 authored by Dipam Chakraborty's avatar Dipam Chakraborty
Browse files

add readme and docs

parent 8c4947de
No related branches found
No related tags found
No related merge requests found
![CPDC Banner](https://images.aicrowd.com/raw_images/challenges/social_media_image_file/1131/341d077b29bc8be92ec6.png)
# [Commonsense Persona-grounded Dialogue Challenge](https://www.aicrowd.com/challenges/commonsense-persona-grounded-dialogue-challenge-2023/problems/task-1-commonsense-dialogue-response-generation) - Task 1 - Starter kit
[![Discord](https://img.shields.io/discord/565639094860775436.svg)](https://discord.gg/fNRrSvZkry)
This repository is the CPD Challenge (Task 1) **Submission template and Starter kit**! Clone the repository to compete now!
**This repository contains**:
* **Documentation** on how to submit your models to the leaderboard
* **The procedure** for best practices and information on how we evaluate your model, etc.
* **Starter code** for you to get started!
# Table of Contents
- [Commonsense Persona-grounded Dialogue Challenge - Task 1 - Starter kit](#commonsense-persona-grounded-dialogue-challenge---task-1---starter-kit)
- [Table of Contents](#table-of-contents)
- [Competition Overview](#competition-overview)
- [Task 1: Commonsense Dialogue Response Generation](#task-1-commonsense-dialogue-response-generation)
- [Getting Started](#getting-started)
- [How to write your own model?](#how-to-write-your-own-model)
- [How to start participating?](#how-to-start-participating)
- [Setup](#setup)
- [How do I specify my software runtime / dependencies?](#how-do-i-specify-my-software-runtime--dependencies)
- [What should my code structure be like?](#what-should-my-code-structure-be-like)
- [How to make a submission?](#how-to-make-a-submission)
- [Other Concepts](#other-concepts)
- [Evaluation Metrics](#evaluation-metrics)
- [Time and compute constraints](#time-and-compute-constraints)
- [Local Evaluation](#local-evaluation)
- [Note about Dummy test data](#note-about-dummy-test-data)
- [Contributing](#contributing)
- [📎 Important links](#-important-links)
# Competition Overview
This challenge is an opportunity for researchers and machine learning enthusiasts to test their skills on the challenging tasks of Commonsense Dialogue Response Generation (Task1) and Commonsense Persona Knowledge Linking (Task2) for persona-grounded dialogue.
Research on dialogue systems has been around for a long time, but thanks to Transformers and Large Language Models (LLM), conversational AI has come a long way in the last five years, becoming more human-like. On the other hand, it is still challenging to collect natural dialogue data for research and to benchmark which models ultimately perform the best because there is no definitive assessment data or metrics, and the comparisons are often within a limited amount of models.
We contribute to the research and development of current state-of-the-art dialogue systems, by crafting high quality human-human dialogues for model testing, and providing a common benchmarking venue by hosting this CPDC 2023 competition.
The competition aims to see the best approach among state-of-the-art participant models on an evaluation dataset of natural conversation. The submitted systems will be evaluated on a new Commonsense Persona-grounded Dialogue dataset. To this end, we first created several persona profiles, similar to [ConvAI2](https://arxiv.org/abs/1902.00098v1), with a natural personality based on a commonsense persona-grounded knowledge graph ([PeaCoK](https://aclanthology.org/2023.acl-long.362/)†) newly released on [ACL 2023](https://2023.aclweb.org/), and allowing us to obtain naturally related persona sentences. Furthermore, based on that persona, we created a natural dialogue between two people and prepared a sufficient amount of dialogue data for evaluation.
The **Commonsense Persona-grounded Dialogue (CPD)** Challenge hosts one track on **Commonsense Dialogue Response Generation (Task 1)** and one track on **Commonsense Persona Knowledge Linking (Task 2)**. Independent leaderboards are set for the two tracks, each featuring a separate prize pool. In either case, participants may use any learning data. In Task 1, participants will submit dialogue response generation systems. We will evaluate them on the prepared persona-grounded dialogue dataset mentioned above. In Task 2, participants will submit systems linking knowledge to a dialogue. This task is designed in the similar spirit of [ComFact](https://aclanthology.org/2022.findings-emnlp.120/), which is released along with the published paper in [EMNLP 2022](https://2022.emnlp.org/). We will evaluate them by checking if the linking of persona-grounded knowledge can be judged successfully on the persona-grounded dialogue dataset.
[PeaCoK: Persona Commonsense Knowledge for Consistent and Engaging Narratives](https://aclanthology.org/2023.acl-long.362/) **(ACL2023 Outstanding Paper Award)**
## [Task 1: Commonsense Dialogue Response Generation](https://www.aicrowd.com/challenges/commonsense-persona-grounded-dialogue-challenge-2023/problems/task-1-commonsense-dialogue-response-generation)
Participants will submit dialogue response generation systems. We do not provide a training dataset, and participants may use any datasets which they want to use. We provide [a baseline model](https://github.com/Silin159/PersonaChat-BART-PeaCoK), which can be tested on the [ConvAI2 PERSONA-CHAT](https://arxiv.org/abs/1902.00098v1) dataset, so that you can see what the problem of this task is. We will evaluate submitted systems on the persona-grounded dialogue dataset. The dialogues in the evaluation dataset have persona sentences similar to the PersonaChat dataset, but the number of persona sentences for a person is more than five sentences. The major part of the persona is derived from the [PeaCoK](https://github.com/Silin159/PeaCoK) knowledge graph.
![](https://lh7-us.googleusercontent.com/rJQ8H9qwj2LtKPswZCiPRD01_cD440o1zymhDPAHsNt4fQaAv9IsYerhlHJmL-2rH88t7WbDRkr2uEKg7MosnLEtWEBMdRYOr9SQD3B09Xjn5vmOMg_6hXXZBMW9uXQaHaF69aWefon64brDQuIBfjU)
# Getting Started
1. **Sign up** to join the competition [on the AIcrowd website](https://www.aicrowd.com/challenges/commonsense-persona-grounded-dialogue-challenge-2023/problems/task-1-commonsense-dialogue-response-generation).
2. **Fork** this starter kit repository. You can use [this link](https://gitlab.aicrowd.com/aicrowd/challenges/commonsense-persona-grounded-dialogue-challenge-2023/commonsense-persona-grounded-dialogue-challenge-task-1-starter-kit/-/forks/new) to create a fork.
3. **Clone** your forked repo and start developing your model.
4. **Develop** your model(s) following the template in [how to write your own model](#how-to-write-your-own-model) section.
5. [**Submit**](#how-to-make-a-submission) your trained models to [AIcrowd Gitlab](https://gitlab.aicrowd.com) for evaluation [(full instructions below)](#how-to-make-a-submission). The automated evaluation setup will evaluate the submissions on the private datasets and report the metrics on the leaderboard of the competition.
# How to write your own model?
We recommend that you place the code for all your models in the `agents/` directory (though it is not mandatory). You should implement the following
- `generate_responses` - This function is called to generate the response of a conversation given two persona information.
**Add your agent name in** `agent/user_config.py`, this is what will be used for the evaluations.
An example are provided in `agent/dummy_agent.py`
# How to start participating?
## Setup
1. **Add your SSH key** to AIcrowd GitLab
You can add your SSH Keys to your GitLab account by going to your profile settings [here](https://gitlab.aicrowd.com/profile/keys). If you do not have SSH Keys, you will first need to [generate one](https://docs.gitlab.com/ee/ssh/README.html#generating-a-new-ssh-key-pair).
2. **Fork the repository**. You can use [this link](https://gitlab.aicrowd.com/aicrowd/challenges/commonsense-persona-grounded-dialogue-challenge-2023/commonsense-persona-grounded-dialogue-challenge-task-1-starter-kit/-/forks/new) to create a fork.
2. **Clone the repository**
```h
git clone git@gitlab.aicrowd.com:aicrowd/challenges/commonsense-persona-grounded-dialogue-challenge-2023/commonsense-persona-grounded-dialogue-challenge-task-1-starter-kit
```
3. **Install** competition specific dependencies!
```
cd commonsense-persona-grounded-dialogue-challenge-task-1-starter-kit
pip install -r requirements.txt
```
4. Write your own model as described in [How to write your own model](#how-to-write-your-own-model) section.
5. Test your model locally using `python local_evaluation.py`
6. Make a submission as described in [How to make a submission](#how-to-make-a-submission) section.
## How do I specify my software runtime / dependencies?
We accept submissions with custom runtime, so you don't need to worry about which libraries or framework to pick from.
The configuration files typically include `requirements.txt` (pypi packages), `apt.txt` (apt packages) or even your own `Dockerfile`.
An example Dockerfile is provided in [utilities/_Dockerfile](utilities/_Dockerfile) which you can use as a starting point.
You can check detailed information about setting up runtime dependencies in the 👉 [docs/runtime.md](docs/runtime.md) file.
## What should my code structure be like?
Please follow the example structure as it is in the starter kit for the code structure.
The different files and directories have following meaning:
```
.
├── aicrowd.json # Submission meta information - like your username
├── apt.txt # Linux packages to be installed inside docker image
├── requirements.txt # Python packages to be installed
├── local_evaluation.py # Use this to check your model evaluation flow locally
├── dummy_data_task1.json # A set of dummy conversations you can use for integration testing
└── agents # Place your models related code here
├── dummy_agent.py # Dummy agent for example interface
└── user_config.py # IMPORTANT: Add your agent name here
```
Finally, **you must specify an AIcrowd submission JSON in `aicrowd.json` to be scored!**
The `aicrowd.json` of each submission should contain the following content:
```json
{
"challenge_id": "task-1-commonsense-dialogue-response-generation",
"authors": ["your-aicrowd-username"],
"gpu": true,
"description": "(optional) description about your awesome model"
}
```
This JSON is used to map your submission to the challenge - so please remember to use the correct `challenge_id` as specified above. You can modify the `authors` and `description` keys. Please DO NOT add any additional keys to `aicrowd.json` unless otherwise communicated during the course of the challenge.
## How to make a submission?
👉 Follow the instuctions provided here [docs/submission.md](docs/submission.md)
**Best of Luck** :tada: :tada:
# Other Concepts
### Evaluation Metrics
### Time and compute constraints
You will be provided conversations with 7 turns each in `batches of upto 50 conversations`. For each batch of conversations, the first set of turns will be provided to your model. After the response is receieved the further turns of the same conversation will be provided. Each conversation will have exactly 7 turns. Your model needs to `complete all 7 responses of 50 conversations within **1 hour**`. The number of batches of conversation your model will process will vary based on the challenge round.
Before running on the challenge dataset, your model will be run on the dummy data, as a sanity check. This will show up as the `convai-validation` phase on your submission pages. The dummy data will contain `5 conversations of 7 turns each`, your model needs to `complete the validation phase within **15 minutes**`.
Your model will be run on an AWS g5.2xlarge node. This node has **8 vCPUs, 32 GB RAM, and one Nvidia A10G GPU with 24 GB VRAM**.
## Local Evaluation
Participants can run the evaluation protocol for their model locally with or without any constraint posed by the challenge to benchmark their models privately. See `local_evaluation.py` for details. You can change it as you like, your changes to `local_evaluation.py` will **NOT** be used for the competition.
## Note about Dummy test data
The file `dummy_data_task1.json` is a dummy test dataset to test your code before submission. All dialogues in the dataset based on a same pair of persona A and persona B, but the actual test dataset for evaluation is not like this and was created based on different pairs of personas.
## Contributing
🙏 You can share your solutions or any other baselines by contributing directly to this repository by opening merge request.
- Add your implemntation as `agents/<your_agent>.py`.
- Import it in `user_config.py`
- Test it out using `python local_evaluation.py`.
- Add any documentation for your approach at top of your file.
- Create merge request! 🎉🎉🎉
# 📎 Important links
- 💪 Challenge Page: https://www.aicrowd.com/challenges/commonsense-persona-grounded-dialogue-challenge-2023/problems/task-1-commonsense-dialogue-response-generation
- 🗣 Discussion Forum: https://www.aicrowd.com/challenges/commonsense-persona-grounded-dialogue-challenge-2023/discussion
- 🏆 Leaderboard: https://www.aicrowd.com/challenges/commonsense-persona-grounded-dialogue-challenge-2023/problems/task-1-commonsense-dialogue-response-generation/leaderboards
# TODO
## How to write your own agents
We recommend that you place the code for all your agents in the `agents` directory (though it is not mandatory). All your submissions should contain an Agent class. We have added dummy agent example in [`dummy_agent.py`](dummy_agent.py). The agent class should contain the `generate_responses`
**Add your agent class name in** [`user_config.py`](user_config.py) as UserAgent
## What does the Agent recieve as input and what outputs are expected
You will be provided conversations with `7 turns each` in `batches of upto 50 conversations`. For each batch of conversations, the first set of turns will be provided to your model. After the response is receieved the further turns of the same conversation will be provided. Each conversation will have exactly 7 turns. Your model needs to `complete all 7 responses of 50 conversations within **1 hour**`. The number of batches of conversation your model will process will vary based on the challenge round.
Each batch will be of the following format:
```python
Input 1
[
{"persona A": ..., "persona B": ... "dialogue": ... }, # conversation 1 Turn 1
...
{"persona A": ..., "persona B": ... "dialogue": ... } # conversation 50 Turn 1
]
Model should return 50 responses for Turn 1
...
Input 7
[
{"persona A": ..., "persona B": ... "dialogue": ... }, # conversation 1 Turn 7
...
{"persona A": ..., "persona B": ... "dialogue": ... } # conversation 50 Turn 7
]
Model should return 50 responses for Turn 7
```
......@@ -8,6 +8,28 @@ class DummyResponseAgent(object):
def generate_responses(self, test_data: List[Dict]) -> List[str]:
"""
You will be provided with a batch of upto 50 independent conversations
Return a string for every conversation
Return a string for every conversation
Input 1
[
{"persona A": ..., "persona B": ... "dialogue": ... }, # conversation 1 Turn 1
...
{"persona A": ..., "persona B": ... "dialogue": ... } # conversation 50 Turn 1
]
Model should return 50 responses for Turn 1
...
Input 7
[
{"persona A": ..., "persona B": ... "dialogue": ... }, # conversation 1 Turn 7
...
{"persona A": ..., "persona B": ... "dialogue": ... } # conversation 50 Turn 7
]
Model should return 50 responses for Turn 7
Note: Turn numbers will NOT be provided as input
"""
# print(f"{len(test_data)=}, {test_data[0].keys()=}, {len(test_data[-1]['dialogue'])}")
return ["THIS IS A TEST REPLY" for _ in test_data]
\ No newline at end of file
## Adding your runtime
This repository is a valid submission (and submission structure).
You can simply add your dependencies on top of this repository.
Few of the most common ways are as follows:
* `requirements.txt` -- The `pip3` packages used by your inference code. As you add new pip3 packages to your inference procedure either manually add them to `requirements.txt` or if your software runtime is simple, perform:
```
# Put ALL of the current pip3 packages on your system in the submission
>> pip3 freeze >> requirements.txt
>> cat requirements.txt
aicrowd_api
coloredlogs
matplotlib
pandas
[...]
```
* `apt.txt` -- The Debian packages (via aptitude) used by your inference code!
These files are used to construct your **AIcrowd submission docker containers** in which your code will run.
* `Dockerfile` -- **For advanced users only**. `Dockerfile` gives you more flexibility on defining the software runtime used during evaluations.
----
To test your image builds locally, you can use [repo2docker](https://github.com/jupyterhub/repo2docker)
# Making submission
This file will help you in making your first submission.
## Submission Entrypoint
The evaluator will create an instance of a Classifier and Ranker specified in from `models/user_config.py` to run the evaluation.
## Setting up SSH keys
You will have to add your SSH Keys to your GitLab account by going to your profile settings [here](https://gitlab.aicrowd.com/profile/keys). If you do not have SSH Keys, you will first need to [generate one](https://docs.gitlab.com/ee/ssh/README.html#generating-a-new-ssh-key-pair).
## Submit using the utility script
You can run the following to make a submission.
```bash
./submit.sh <description-phrase> # example: ./submit.sh my-first-model
```
`./submit.sh` contains a few git commands that will push your code to AIcrowd GitLab.
**Note:** In case you see an error message like `git: 'lfs' is not a git command. See 'git --help'.`, please make sure you have git LFS installed. You can install it using `git lfs install` or refer [Git LFS website](https://git-lfs.github.com/).
If the script `submit.sh` doesn't work for you, you can try to push your agents manually using the following steps.
## Pushing the code manually
### IMPORTANT: Saving Models before submission!
Before you submit make sure that you have saved your models, which are needed by your inference code.
In case your files are larger in size you can use `git-lfs` to upload them. More details [here](https://discourse.aicrowd.com/t/how-to-upload-large-files-size-to-your-submission/2304).
## How to submit your code?
You can create a submission by making a _tag push_ to your repository on [https://gitlab.aicrowd.com/](https://gitlab.aicrowd.com/).
**Any tag push (where the tag name begins with "submission-") to your private repository is considered as a submission**
```bash
cd commonsense-persona-grounded-dialogue-challenge-task-1-starter-kit
# Add AIcrowd git remote endpoint
git remote add aicrowd git@gitlab.aicrowd.com:<YOUR_AICROWD_USER_NAME>/commonsense-persona-grounded-dialogue-challenge-task-1-starter-kit.git
git push aicrowd master
```
```bash
# Commit All your changes
git commit -am "My commit message"
# Create a tag for your submission and push
git tag -am "submission-v0.1" submission-v0.1
git push aicrowd master
git push aicrowd submission-v0.1
# Note : If the contents of your repository (latest commit hash) does not change,
# then pushing a new tag will **not** trigger a new evaluation.
```
You now should be able to see the details of your submission at:
`https://gitlab.aicrowd.com/<YOUR_AICROWD_USER_NAME>/commonsense-persona-grounded-dialogue-challenge-task-1-starter-kit/issues`
**NOTE**: Please remember to update your username instead of `<YOUR_AICROWD_USER_NAME>` in the above link
\ No newline at end of file
from typing import List, Dict
import json
import numpy as np
import math
from metrics import word_f1, bleu
from agents.user_config import UserAgent
def load_json_data(file_path: str, keys: List[str], modifications: dict = None) -> List[Dict]:
def load_json_data(file_path: str, keys: List[str]) -> List[Dict]:
with open(file_path, "r") as fp:
data = json.load(fp)
......@@ -15,24 +16,24 @@ def load_json_data(file_path: str, keys: List[str], modifications: dict = None)
for dialogue in data:
updated_dialogue = {}
for turn_id, sample in dialogue.items():
if not isinstance(sample, dict):
continue
sample_data = {key: sample[key] for key in keys}
if modifications:
for key, value in modifications.items():
sample_data[key] = value(sample_data[key])
updated_dialogue[turn_id] = sample_data
result.append(updated_dialogue)
return result
def load_data(file_path: str) -> List[Dict]:
keys = ["persona A", "persona B", "dialogue", "gold_reference"]
modifications = {"dialogue": lambda x: x[:-1]}
return load_json_data(file_path, keys, modifications)
# NOTE to participants: Gold reference will not available during actual evaluations
keys = ["persona A", "persona B", "dialogue", "gold_reference"]
return load_json_data(file_path, keys)
def get_responses(agent, test_data, BATCH_SIZE):
all_responses = [{} for _ in range(len(test_data))]
for batch_idx in np.array_split(range(len(test_data)), BATCH_SIZE):
split_size = math.ceil(len(test_data) / BATCH_SIZE)
for batch_idx in np.array_split(range(len(test_data)), split_size):
for turn_id in range(7):
batch_inputs = [test_data[i][f"turn_{turn_id}"] for i in batch_idx]
responses = agent.generate_responses(batch_inputs)
......@@ -55,7 +56,7 @@ def evaluate(responses, test_data):
return np.mean(f1_scores), np.mean(bleu_scores)
if __name__ == "__main__":
BATCH_SIZE = 2
BATCH_SIZE = 2
data_path = 'dummy_data_task1.json'
test_data = load_data(data_path)
agent = UserAgent()
......
submit.sh 0 → 100644
#!/bin/bash
set -e
REPO_ROOT_DIR=$(git rev-parse --show-toplevel)
log_info() {
echo -e "\033[0;36m$@\033[0m"
}
log_success() {
echo -e "\033[0;32m$@\033[0m"
}
log_normal() {
echo -e "$@"
}
log_error() {
>&2 echo -e "\033[0;31m$@\033[0m"
}
print_usage() {
cat << USAGE
Utility script to make submissions.
It adds current working directory files, setup lfs, commit and upload it to AIcrowd GitLab.
Usage: ./submit.sh <unique-submission-name>
Example:
./submit.sh "bayes-v0.1"
Prerequisite:
Install aicrowd-cli and login on AIcrowd
#> pip install -U aicrowd-cli
#> aicrowd login
USAGE
}
bad_remote_message() {
log_error "AIcrowd remote not found"
log_error "It should have been automatically set, but given it isn't. Please run \`git remote add aicrowd git@gitlab.aicrowd.com:<username>/meltingpot-2023-starter-kit\` manually."
exit 1
}
get_submission_remote() {
echo "aicrowd"
}
get_submission_remote_url() {
git remote get-url aicrowd
}
check_remote() {
log_info Checking git remote settings...
get_submission_remote > /dev/null
log_success Using $(get_submission_remote_url | awk -F'@' '{print $NF}' | sed 's|\.git||g') as the submission repository
}
setup_lfs() {
git lfs install
find * -type f -size +5M -exec git lfs track {} &> /dev/null \;
set +e
git ls-files -om | grep ".gitattributes" &> /dev/null \
&& git add .gitattributes \
&& git commit -m "auto: tracking new files via LFS" &> /dev/null
set -e
}
setup_commits() {
REMOTE=$(get_submission_remote)
TAG=$(echo "$@" | sed 's/ /-/g')
git add --all
git commit -m "Changes for submission-$TAG" || true # don't exit when no new commits are there
git tag -am "submission-$TAG" "submission-$TAG" || (log_error "There is another submission with the same description. Please give a different description." && exit 1)
git push -f $REMOTE master
git push -f $REMOTE "submission-$TAG"
log_success "Check the submission progress in your repository: $(get_submission_remote_url | awk -F'@' '{print $NF}' | sed 's|\.git||g')/issues"
}
check_cli_install() {
set +e
which aicrowd > /dev/null
retval=$?
if [ $retval -ne 0 ]; then
log_error 'Please install AIcrowd CLI using `pip install -U aicrowd-cli`';exit 1
fi
python -c 'from aicrowd.contexts.config import CLIConfig;c=CLIConfig();c.load(None);exit(1) if c.get("aicrowd_api_key") is None else True'
retval=$?
if [ $retval -ne 0 ]; then
log_error 'Please login to AIcrowd using `aicrowd login`';exit 1
fi
export USERNAME=$(python -c 'from aicrowd.contexts.config import CLIConfig;c=CLIConfig();c.load(None);print(c.get("gitlab")["username"])')
retval=$?
if [ $retval -ne 0 ]; then
log_error 'You might be on older AIcrowd CLI version. Please upgrade using `pip install -U aicrowd-cli` and login again.';exit 1
fi
export OAUTH=$(python -c 'from aicrowd.contexts.config import CLIConfig;c=CLIConfig();c.load(None);print(c.get("gitlab")["oauth_token"])')
git remote add aicrowd https://oauth2:$OAUTH@gitlab.aicrowd.com/$USERNAME/commonsense-persona-grounded-dialogue-challenge-task-1-starter-kit 2> /dev/null
git config lfs.https://oauth2:$OAUTH@gitlab.aicrowd.com/$USERNAME/commonsense-persona-grounded-dialogue-challenge-task-1-starter-kit/info/lfs.locksverify true
git config lfs.https://gitlab.aicrowd.com/$USERNAME/commonsense-persona-grounded-dialogue-challenge-task-1-starter-kit/info/lfs.locksverify true
retval=$?
if [ $retval -ne 0 ]; then
log_normal "Remote already exit, repository location: $(get_submission_remote | awk -F'@' '{print $NF}' | sed 's|\.git||g')";
fi
git config --global user.email > /dev/null
retval=$?
if [ $retval -ne 0 ]; then
export GITID=$(python -c 'from aicrowd.contexts.config import CLIConfig;c=CLIConfig();c.load(None);print(c.get("gitlab")["userid"])')
log_normal "Git setup dont have email defined, setting it to \"${GITID}-${USERNAME}@users.noreply.gitlab.aicrowd.com\""
git config --global user.email "${GITID}-${USERNAME}@users.noreply.gitlab.aicrowd.com"
git config --global user.name $USERNAME
fi
log_success "Making submission as \"${USERNAME}\""
set -e
}
submit() {
check_cli_install
check_remote
setup_lfs "$@"
setup_commits "$@"
}
if [[ $# -lt 1 ]]; then
print_usage
exit 1
fi
submit "$@"
## This is an example Dokerfile you can change to make submissions on aicrowd
## To use it, place it in the base of the repo, and remove the underscore (_) from the filename
FROM nvidia/cuda:11.8.0-cudnn8-runtime-ubuntu20.04
ENV DEBIAN_FRONTEND=noninteractive
COPY apt.txt /tmp/apt.txt
RUN apt -qq update && apt -qq install -y --no-install-recommends `cat /tmp/apt.txt` \
&& rm -rf /var/cache/*
RUN apt install -y locales wget
# Unicode support:
RUN locale-gen en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
# Create user home directory - This is needed for aicrowd submissions
ENV USER_NAME aicrowd
ENV HOME_DIR /home/$USER_NAME
# Replace HOST_UID/HOST_GUID with your user / group id
ENV HOST_UID 1001
ENV HOST_GID 1001
# Use bash as default shell, rather than sh
ENV SHELL /bin/bash
# Set up user
RUN adduser --disabled-password \
--gecos "Default user" \
--uid ${HOST_UID} \
${USER_NAME}
USER ${USER_NAME}
WORKDIR ${HOME_DIR}
ENV CONDA_DIR ${HOME_DIR}/.conda
RUN wget -nv -O miniconda.sh https://repo.anaconda.com/miniconda/Miniconda3-py38_22.11.1-1-Linux-x86_64.sh \
&& bash miniconda.sh -b -p ${CONDA_DIR} \
&& . ${CONDA_DIR}/etc/profile.d/conda.sh \
&& conda clean -y -a \
&& rm -rf miniconda.sh
ENV PATH ${CONDA_DIR}/bin:${PATH}
RUN conda install cmake -y && conda clean -y -a
COPY --chown=1001:1001 requirements.txt ${HOME_DIR}/requirements.txt
RUN pip install -r requirements.txt --no-cache-dir
COPY --chown=1001:1001 . ${HOME_DIR}
## Add your custom commands below
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment