Kevin Zhang

Results 43 comments of Kevin Zhang

I did not see the funcion calling example in https://github.com/hwchase17/langchain/pull/6113 like in openai site for custom `function` as below, how to integrate with it using LangChain? ``` import openai import...

添加了Dockerfile [146](https://github.com/harry0703/MoneyPrinterTurbo/pull/146),麻烦review下。@harry0703

>支持设置密码 这个可以添加一下fastapi的auth功能,搞一个简单的通过key,后面可以使用oauth2。

Make sense, I think we have two options to do this: 1. For the long term, we can provide the capabilities for editing the final generated videos; 2. Currently, we...

> > @KevinZhang19870314 没有没试过,会不会爆显存?看起来似乎没有将weight移到内存。(在tts完之后 > > 可以用TTS.set_device(),在合成完之后移到cpu,要用的时候再移到gpu @ChasonJiang 你好,我对PyTorch实在不熟悉,按照review的提示,我修改了一版,麻烦有空看一下(或者不对也可以修改一版?)。 另外我这边暂时没有显卡设备,所以也没法测试,只在CPU机器上面测试没问题。

我这里想到的有2个方案,下面分别举一个示例代码: 1. 使用类似模型池model pool的概念(这里可以限制一下pool size): ```python from fastapi import FastAPI from threading import Lock app = FastAPI() model_pool = {} model_pool_lock = Lock() @app.post("/tts") async def tts(text: str, weights_path: str):...

> > 我这里想到的有2个方案,下面分别举一个示例代码: > > 这是一个关于并发的问题,可以按照你这两个方法基本思路来做。把t2s_weights换成TTS类实例就行,也就是说创建一个TTS类的实例的pool(TTS instance pool)。 不过需要注意的是,你需要以task的视角去做,也就是说,每一个tts请求是一个task,每个task将占有一个TTS类的实例,然后根据你服务器的性能决定你能并发运行多少个TTS类的实例。 还有,既然规定了能够并发的上限。也就需要为task设置一个队列(task_queue),同时需要使用一个简单的调度器,用来调度task和管理TTS_instance。 总之,实现起来还挺麻烦的。 看了你的回答,我觉得与这个项目的实现比较像(我之前提的一个PR),麻烦您抽时间看看是否类似?[feat: add support for maximum concurrency of /api/v1/videos](https://github.com/harry0703/MoneyPrinterTurbo/pull/267/files)

> > 看了你的回答,我觉得与这个项目的实现比较像(我之前提的一个PR),麻烦您抽时间看看是否类似?[feat: add support for maximum concurrency of /api/v1/videos](https://github.com/harry0703/MoneyPrinterTurbo/pull/267/files) > > 嗯嗯,是类似的。不过要注意一个task应占有一个TTS类的实例,不然会导致生成的音频发生混乱。 https://github.com/RVC-Boss/GPT-SoVITS/blob/35e755427da174037da246642cab6987876c74fa/api_v2.py#L143 本地跑了一下,这一句执行时间以秒为单位的(差不多3~5秒,一般的办公笔记本,CPU),如果一个task用一个TTS实例,感觉还是比较费时间的。感觉还是多开比较好(使用类似supervisor),一个声音一个api服务,初始化的时候加载进内存。 如果执意要这么做,初始化的时候得维护一个tts的dict,后面每次调用去这个dict拿,这样应该是可以的。那么这样的话就可以用到`functools.lru_cache get_tts_instance(voice_name: str)`来维护这个dict了。

暂时使用lru cache实现了一下,后面有空结合lru cache和[feat: add support for maximum concurrency of /api/v1/videos](https://github.com/harry0703/MoneyPrinterTurbo/pull/267/files)再重构一下(如果需要的话)。

I think you need to set `ngProjectAs` property to ng-container ```html Correct (without ng-container) Default Content Footer Content Buggy (with ng-container) Default Content Footer Content ```