Skip to content

Commit

Permalink
Update readme with new chatbot_model format.
Browse files Browse the repository at this point in the history
  • Loading branch information
zh-plus committed May 17, 2024
1 parent b345da5 commit fb613a3
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,20 @@ e.g. [OpenAI-GPT](https://github.com/openai/openai-python), [Anthropic-Claude](h
- Add custom endpoint (base_url) support for OpenAI & Anthropic:
```python
lrcer = LRCer(base_url_config={'openai': 'https://api.chatanywhere.tech',
'anthropic': 'https://api.g4f.icu'})
'anthropic': 'https://example/api'})
```
- Generating bilingual subtitles
```python
lrcer.run('./data/test.mp3', target_lang='zh-cn', bilingual_sub=True)
```
- 2024.5.11: Add glossary into prompt, which is confirmed to improve domain specific translation.
Check [here](#glossary) for details.
- 2024.5.17: You can route model to arbitrary Chatbot SDK (either OpenAI or Anthropic) by setting `chatbot_model` to
`provider: model_name` together with base_url_config:
```python
lrcer = LRCer(chatbot_model='openai: claude-3-haiku-20240307',
base_url_config={'openai': 'https://api.g4f.icu/v1/'})
```

## Installation ⚙️

Expand Down Expand Up @@ -146,8 +152,12 @@ if __name__ == '__main__':
lrcer.run('./data/test.mp3', target_lang='zh-cn', clear_temp_folder=True)

# Change base_url
lrcer = LRCer(base_url_config={'openai': 'https://api.chatanywhere.tech',
'anthropic': 'https://api.g4f.icu'})
lrcer = LRCer(base_url_config={'openai': 'https://api.g4f.icu/v1',
'anthropic': 'https://example/api'})

# Route model to arbitrary Chatbot SDK
lrcer = LRCer(chatbot_model='openai: claude-3-sonnet-20240229',
base_url_config={'openai': 'https://api.g4f.icu/v1/'})

# Bilingual subtitle
lrcer.run('./data/test.mp3', target_lang='zh-cn', bilingual_sub=True)
Expand Down

0 comments on commit fb613a3

Please sign in to comment.