Skip to content

janhq/ichigo-package

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ichigo Package

PyPI

  1. Setup package with python=3.10 (dev)
python -m build
python -m twine upload dist/* 
  1. Install python package
pip install ichigo

ASR

Batch Processing

Transcribe with your audio file

# Quick one-liner
from ichigo.asr import transcribe
results = transcribe("path/to/file/or/folder")

# Or with more control using the model class
from ichigo.asr import IchigoASR
model = IchigoASR(model_name="custom-model", model_path="path/to/model/hub")
results = model.transcribe(
    "path/to/file/or/folder",
    output_path="./output_folder",
    extensions=(".wav", ".mp3", ".flac", ".m4a")
)

API

# Start the API server
uvicorn ichigo.asr.server:app --host 0.0.0.0 --port 8000

# Use with curl
curl -X POST "http://localhost:8000/transcribe/" \
  -H "accept: application/json" \
  -H "Content-Type: multipart/form-data" \
  -F "file=@path/to/audio.wav"

# Get semantic tokens
curl -X POST "http://localhost:8000/transcribe/?return_stoks=true" \
  -H "accept: application/json" \
  -H "Content-Type: multipart/form-data" \
  -F "file=@path/to/audio.wav"

You can also access the API documentation at http://localhost:8000/docs

LLMs

Python Usage

# Quick one-liner for audio processing
from ichigo.llm import process_audio
response = process_audio("path/to/audio.wav")

# Or with more control using the assistant class
from ichigo.llm import IchigoAssistant
# Use default Ichigo model
assistant = IchigoAssistant()
# Or use Speechless model
assistant = IchigoAssistant(use_speechless=True)

response = assistant.generate_text(
    "path/to/audio.wav",
    max_new_tokens=2048
)

API

# Start the API server
uvicorn ichigo.llm.server:app --host 0.0.0.0 --port 8001

# Use with default Ichigo model
curl -X POST "http://localhost:8001/chat/" \
  -H "accept: application/json" \
  -H "Content-Type: multipart/form-data" \
  -F "file=@path/to/audio.wav"

# Use with Speechless model
curl -X POST "http://localhost:8001/chat/?use_speechless=true" \
  -H "accept: application/json" \
  -H "Content-Type: multipart/form-data" \
  -F "file=@path/to/audio.wav"

You can also access the API documentation at http://localhost:8001/docs

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%