replicate / replicate/cog

Make it easier to write good docs for model inputs

Open
#1,329 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

documentation papercut
Dominant language
Go
Stars
9.5k
Forks
696
Avg merge
7d 19h
Merged PRs (30d)
2

Description

Have you ever come across a Replicate model input like this one?

Screenshot 2023-10-04 at 6 00 24 PM


🤔 What is "classifier-free guidance"? Surely some experts know, but not me. I'll go look in the README. Hmm it's not in the README. I guess I just won't change that setting! Since I don't know what it will do, It's not worth it to change the value, wait for a prediction, then try find out what effect it had.

If the description looked more like this, I'd be more likely to experiment with changing its value:


Screenshot 2023-10-04 at 6 12 46 PM


Putting more detail in the input description itself means that users see it in lots of useful contexts, like when they're:

  • filling out the web form
  • using "Intellisense" in their $EDITOR
  • referring to a model's API docs

On the other hand, as a model author, the current Python DSL(?) for documenting an input makes writing a long description feel a bit awkward:

def predict(self,
    guidance_scale: float = Input(
        description="I don't want to make this too long because if I do the line will go on forever and push the other inputs out of view and this just feels unholy to write a single-line string this long I guess I could put it in a variable but that would be overkill maybe?", ge=1, le=50, default=7.5
    ),
)

I'm opening this issue to brainstorm on how we can make it easier for model authors to "do the right thing" (write good docs) when creating the interface to the model's (Cog) interface.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the linked predict.py example and the Python Input DSL shown in the issue, then consider how descriptions appear in the README, web form, editor assistance, and API documentation. Done should mean an agreed, documented approach that makes writing detailed model-input descriptions easier for model authors.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
documentation
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.