Skip to content

Provide documentation for instructions to call a python function with named parameters #6

Open

Description

@mighty-phoenix
Could not download 'speaker-diarization-3.1' pipeline.
It might be because the pipeline is private or gated so make
sure to authenticate. Visit https://hf.co/settings/tokens to
create your access token and retry with:

   >>> Pipeline.from_pretrained('speaker-diarization-3.1',
   ...                          use_auth_token=YOUR_AUTH_TOKEN)

I tried several patterns and failed to figure how to call the function correctly. Here is the code I was trying:

// Assign speaker labels
const diarizeModel = this.whisperx.DiarizationPipeline("speaker-diarization-3.1", {use_auth_token: process.env.HF_TOKEN})

I also tried using kw to pass the use_auth_token param but still failed.

const diarizeModel = this.whisperx.DiarizationPipeline("speaker-diarization-3.1", kw`use_auth_token=${process.env.HF_TOKEN}`)

Quick advice would be highly appreciated.
Thanks!

Activity

  1. mighty-phoenix commented on Jan 28, 2025

    @mighty-phoenix
    Author
  2. codehz commented on Jan 28, 2025

    @codehz
    Owner

    try basic test code:

    const { Test } = python.runModule(`
    class Test:
      def test(self, *args, **kwargs):
        return all([len(args) == 3, "name" in kwargs])
    `);
        const t = new Test();
    
        const d = python.dict({ a: 1, b: 2 });
        const v = t.test(1, 2, kw`name=${"vampire"}`, d);
        console.log(v)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions