File size: 1,364 Bytes
8a94aee
e4f691b
8a94aee
e4f691b
8a94aee
e4f691b
8a94aee
e4f691b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
---
title: hackaprompt
sdk: gradio
app_file: hackaprompt/gradio_app.py
---
# Hackaprompt

Code for hosting and evaluating the hackaprompt competition.

## Installation

Clone the repository

    cd && git clone https://github.com/jerpint/hackaprompt/

Create a python environment with `python>=3.9`, then:

    cd ~/hackaprompt
    pip install -e .

## Gradio App

To run the gradio app:

    cd ~/hackaprompt/hackprompt && gradio gradio_app.py


## Evaluation

    cd ~/hackaprompt/hackaprompt && python score_submission.py


## Deployment on HF Space

To deploy on HuggingFace space, first, create a space. Then:

    git remote add space https://huggingface.co/spaces/jerpint/hackaprompt
    git push --force space main

## Secrets

### MongoDB

To enable logging to MongoDB, you need to add the following env. variables to your environment:

    export HACKAPROMPT_MONGODB_USERNAME=...
    export HACKAPROMPT_MONGODB_PASSWORD=...
    export HACKAPROMPT_MONGODB_CLUSTER=...
    export HACKAPROMPT_MONGODB_DB_NAME=...


### Flan endpoint

The Flan model is hosted on a private space exclusively for this competition. To use it, it needs to have the valid hf token associated to it to authenticate:

    export HUB_TOKEN=hf_...

### OpenAI

To run tests and evaluations, a valid openai api key should be set as an env. variable:

    export OPENAI_API_KEY=sk-...