Skip to content

Commit

Permalink
Fix CI issues. (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
zh-plus authored Dec 9, 2024
1 parent 99944fc commit 972282d
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 15 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [ "3.9", "3.10", "3.11", "3.12" ]
python-version: [ "3.10", "3.11", "3.12" ]
os: [ windows-latest, ubuntu-latest ]

defaults:
Expand Down Expand Up @@ -47,13 +47,18 @@ jobs:
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 1.8.4
- name: Install dependencies
run: |
poetry lock --no-update
poetry install
poetry run pip uninstall -y faster-whisper
poetry run pip install "faster-whisper @ https://github.com/SYSTRAN/faster-whisper/archive/d57c5b40b06e59ec44240d93485a95799548af50.tar.gz"
poetry run pip install "faster-whisper @ https://github.com/SYSTRAN/faster-whisper/archive/8327d8cc647266ed66f6cd878cf97eccface7351.tar.gz"
- name: Install extra dependencies
run: |
poetry run pip install --force-reinstall torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu124
poetry run pip install -U typing-extensions
- name: Install ffmpeg
uses: FedericoCarboni/setup-ffmpeg@v2
Expand Down
23 changes: 13 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ e.g. [OpenAI-GPT](https://github.com/openai/openai-python), [Anthropic-Claude](h
a [specific commit](https://github.com/SYSTRAN/faster-whisper/commit/d57c5b40b06e59ec44240d93485a95799548af50) of
faster-whisper, which is not published on PyPI. Install it from source:
```shell
pip install "faster-whisper @ https://github.com/SYSTRAN/faster-whisper/archive/d57c5b40b06e59ec44240d93485a95799548af50.tar.gz"
pip install "faster-whisper @ https://github.com/SYSTRAN/faster-whisper/archive/8327d8cc647266ed66f6cd878cf97eccface7351.tar.gz"
```

## Installation ⚙️
Expand All @@ -72,15 +72,10 @@ e.g. [OpenAI-GPT](https://github.com/openai/openai-python), [Anthropic-Claude](h
`ANTHROPIC_API_KEY`.
- Add your [Google API Key](https://aistudio.google.com/app/apikey) to environment variable `GOOGLE_API_KEY`.

3. Install latest [fast-whisper](https://github.com/guillaumekln/faster-whisper) from source:
```shell
pip install "faster-whisper @ https://github.com/SYSTRAN/faster-whisper/archive/8327d8cc647266ed66f6cd878cf97eccface7351.tar.gz"
```

4. Install [ffmpeg](https://ffmpeg.org/download.html) and add `bin` directory
3. Install [ffmpeg](https://ffmpeg.org/download.html) and add `bin` directory
to your `PATH`.

5. This project can be installed from PyPI:
4. This project can be installed from PyPI:

```shell
pip install openlrc
Expand All @@ -92,11 +87,21 @@ e.g. [OpenAI-GPT](https://github.com/openai/openai-python), [Anthropic-Claude](h
pip install git+https://github.com/zh-plus/openlrc
```

5. Install latest [fast-whisper](https://github.com/guillaumekln/faster-whisper) from source:
```shell
pip install "faster-whisper @ https://github.com/SYSTRAN/faster-whisper/archive/8327d8cc647266ed66f6cd878cf97eccface7351.tar.gz"
```

6. Install [PyTorch](https://pytorch.org/get-started/locally/):
```shell
pip install --force-reinstall torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu124
```

7. Fix the `typing-extensions` issue:
```shell
pip install typing-extensions -U
```

## Usage 🐍

[//]: # (### GUI)
Expand Down Expand Up @@ -292,10 +297,8 @@ To maintain context between translation segments, the process is sequential for

[![Star History Chart](https://api.star-history.com/svg?repos=zh-plus/Open-Lyrics&type=Date)](https://star-history.com/#zh-plus/Open-Lyrics&Date)


## Citation


```
@book{openlrc2024zh,
title = {zh-plus/openlrc},
Expand Down
4 changes: 2 additions & 2 deletions openlrc/chatbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ def __init__(self, model_name='gpt-4o-mini', temperature=1, top_p=1, retry=8, ma

self.async_client = AsyncGPTClient(
api_key=os.environ['OPENAI_API_KEY'],
http_client=httpx.AsyncClient(proxies=proxy),
http_client=httpx.AsyncClient(proxy=proxy),
base_url=base_url_config['openai'] if base_url_config and base_url_config['openai'] else None
)

Expand Down Expand Up @@ -267,7 +267,7 @@ def __init__(self, model_name='claude-3-5-sonnet-20241022', temperature=1, top_p
self.async_client = AsyncAnthropic(
api_key=os.environ['ANTHROPIC_API_KEY'],
http_client=httpx.AsyncClient(
proxies=proxy
proxy=proxy
),
base_url=base_url_config['anthropic'] if base_url_config and base_url_config['anthropic'] else None
)
Expand Down
2 changes: 1 addition & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ ctranslate2 = "^4.5.0"
google-generativeai = "0.8.3"
json_repair = "0.25.2"
matplotlib = "^3.9.2"
typing-extensions = "^4.12.2"
onnxruntime = "^1.20.0"

#torch = ">=2.0.0, !=2.0.1"
#torchaudio = "^2.0.0"
Expand Down

0 comments on commit 972282d

Please sign in to comment.