GithubHelp home page GithubHelp logo

static-rlhf-interface's Introduction

title emoji colorFrom colorTo sdk sdk_version app_file pinned
RLHF
๐Ÿข
red
gray
gradio
3.1
app.py
false

An RLHF interface for data collection with Amazon Mechanical Turk and Gradio.

Instructions for someone to use for their own project

Install dependencies

First, create a Python virtual environment and install the project's dependencies as follows:

python -m pip install -r requirements.txt

Setting up the Space

  1. Clone this repo and deploy it on your own Hugging Face space.
  2. Add the following secrets to your space:
    • HF_TOKEN: One of your Hugging Face tokens.
    • DATASET_REPO_URL: The url to an empty dataset that you created the hub. It can be a private or public dataset.
    • FORCE_PUSH: "yes" When you run this space on mturk and when people visit your space on huggingface.co, the app will use your token to automatically store new HITs in your dataset. Setting FORCE_PUSH to "yes" ensures that your repo will force push changes to the dataset during data collection. Otherwise, accidental manual changes to your dataset could result in your space getting merge conflicts as it automatically tries to push the dataset to the hub. For local development, add these three keys to a .env file, and consider setting FORCE_PUSH to "no".

To launch the Space locally, run:

python app.py

The app will then be available at a local address, such as http://127.0.0.1:7860

Running data collection*

  1. On your local repo that you pulled, create a copy of config.py.example, just called config.py. Now, put keys from your AWS account in config.py. These keys should be for an AWS account that has the AmazonMechanicalTurkFullAccess permission. You also need to create an mturk requestor account associated with your AWS account.
  2. Run python collect.py locally.

Profit

Now, you should be watching hits come into your Hugging Face dataset automatically!

Tips and tricks

  • Use caution while doing local development of your space and simultaneously running it on mturk. Consider setting FORCE_PUSH to "no" in your local .env file.
  • huggingface spaces have limited computational resources and memory. If you run too many HITs and/or assignments at once, then you could encounter issues. You could also encounter issues if you are trying to create a dataset that is very large. Check the log of your space for any errors that could be happening.

static-rlhf-interface's People

Contributors

tristanthrush avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.