binary-husky

Results 331 comments of binary-husky

也许是第三方的兼容性问题,可把第三方样本api发我测试一下 qq505030475

你好,可以把config.py中的变更清除,然后放到get_conf中吗,我们希望config.py保持简单、易拓展的状态 https://github.com/binary-husky/gpt_academic/blob/9d3b01af754a0a950bde4c58ecb91a044e32b889/toolbox.py#LL520C1-L526C60 比如 ``` try: r = getattr(importlib.import_module('config_private'), arg) except: r = getattr(importlib.import_module('config'), arg) ``` 修改成 ``` try: r = os.environ[arg] # 获取环境变量(arg) except KeyError: try: r = getattr(importlib.import_module('config_private'), arg)...

> 我需要直接在read_single_conf_with_lru_cache函数中对于环境变量进行格式的处理吗?这样感觉很多非str的类型都需要重新做一次判断,感觉会导致函数比较臃肿。 或者是新建一个config_env.py将环境变量转换成config.py的格式再在这里导入 字符串可以根据默认值的数据类型,进行转换,下面这个函数是我在另一个项目中用的代码,这里不需要的数据类型可以直接raise error也行 ``` def auto_convertion(): replace_item = # 环境变量值(字符串) original_item = # config.py中的默认值 if isinstance(original_item, float): replace_item = float(replace_item) elif isinstance(original_item, bool): if replace_item == 'True': replace_item...

> 应该修改完毕了,主要的逻辑在这里:[e5e3e0a#diff-71e5cf52ccb5b80caa00b86ae70d9e941a3e5cdb8279d7cb5c197c636cd79ee4R521](https://github.com/binary-husky/gpt_academic/commit/e5e3e0aa43d8db8b5d731dbabcb1f44d1fed7808#diff-71e5cf52ccb5b80caa00b86ae70d9e941a3e5cdb8279d7cb5c197c636cd79ee4R521) 代码中给环境变量加了一个前缀是为了防止和其他已有项目之间造成冲突。 > > 简单跑了一下这个测试是正常的,但是没有具体测试每个值的情况。 > > ```yaml > # docker-compose.yml > version: '3' > services: > gpt_academic: > image: ghcr.io/sperjar/gpt_academic:master > container_name: gpt_academic > environment: > GPT_ACADEMIC_API_KEY: your-api-key-here...

这样写更简单明了一点,我在windows cmd中进行了测试没问题,请您试一下docker compose是否一样work ``` 环境变量可以是 `GPT_ACADEMIC_CONFIG`(优先),也可以直接是`CONFIG` 例如在windows cmd中,既可以写: set USE_PROXY=True set API_KEY=sk-j7caBpkRoxxxxxxxxxxxxxxxxxxxxxxxxxxxx set proxies={"http":"http://127.0.0.1:10085", "https":"http://127.0.0.1:10085",} set AVAIL_LLM_MODELS=["gpt-3.5-turbo", "chatglm"] set AUTHENTICATION=[("username", "password"), ("username2", "password2")] 也可以写: set GPT_ACADEMIC_USE_PROXY=True set GPT_ACADEMIC_API_KEY=sk-j7caBpkRoxxxxxxxxxxxxxxxxxxxxxxxxxxxx set GPT_ACADEMIC_proxies={"http":"http://127.0.0.1:10085",...

以前从来没用过docker-compose,是这样写的吗?(不好看, 但是似乎管用) ```yaml version: '3' services: gpt_academic: image: fuqingxu/gpt_academic:no-local-llms container_name: gpt_academic environment: # see `config.py` all configuration options ! API_KEY: ' your-api-key-here ' WEB_PORT: ' 10054 ' proxies: ' {"http":"http://127.0.0.1:10085",...

能详细说说吗,啥是azure openai key

好的谢谢,我们调查下相关情况

> I also looking for a solution with the Azure OpenAPI key instead of the ChatGPT API key. Looking forward to this feature to update get, working on it

https://github.com/binary-husky/chatgpt_academic/issues/554