CoolFace
Apppublic

eatcosmos/hackaprompt

sourceHugging Faceupdated 3y agoView on Hugging Face
1likes
App README

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 HACKAPROMPTMONGODBUSERNAME=... export HACKAPROMPTMONGODBPASSWORD=... export HACKAPROMPTMONGODBCLUSTER=... export HACKAPROMPTMONGODBDB_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 HUBTOKEN=hf...

OpenAI

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

export OPENAIAPIKEY=sk-...