pdf_translator
pdf_translator copied to clipboard
gpt API
可以使用中转的API嘛?不使用apenai官方的API?
I am not familiar with transit API, probably it would require some modifications to the code.
可以使用中转的API嘛?不使用apenai官方的API?
可以,修改openai_gpt.py
self.client = OpenAI(api_key=cfg['openai_api_key'],base_url=cfg['base_url'])
然后在config.yaml中增加:
translator:
type: openai
openai_api_key: 'sk-xxx'
base_url: 'http://xxx.xxx/v1'
可以使用中转的API嘛?不使用apenai官方的API?
可以,修改openai_gpt.py
self.client = OpenAI(api_key=cfg['openai_api_key'],base_url=cfg['base_url'])
然后在config.yaml中增加:translator: type: openai openai_api_key: 'sk-xxx' base_url: 'http://xxx.xxx/v1'
可以自定义model 么?
可以使用中转的API嘛?不使用apenai官方的API?
可以,修改openai_gpt.py
self.client = OpenAI(api_key=cfg['openai_api_key'],base_url=cfg['base_url'])
然后在config.yaml中增加:translator: type: openai openai_api_key: 'sk-xxx' base_url: 'http://xxx.xxx/v1'
可以自定义model 么?
利用 one-api 的 model 映射功能,可以使用任意自定义的 model