Giter VIP home page Giter VIP logo

Comments (10)

souvenp avatar souvenp commented on August 16, 2024

另外我有一个想法,普通gpt号好像就3个请求每分钟,可以尝试把文本集中起来翻译完成后再组装上去🤔

from n46whisper.

souvenp avatar souvenp commented on August 16, 2024

目前的谷歌加载文件没法显示共享文件夹
清缓存有个时间,稍微改了下,

memory_allocated = torch.cuda.max_memory_allocated()
print(end_memory_allocated)
threshold = 8e9  # 8 GB
flag=False
while(memory_allocated < threshold):
       if(flag):
          break
       print('加载模型 Loading model...')
       torch.cuda.empty_cache()
       model = WhisperModel(model_size)
       flag=True
       memory_allocated = torch.cuda.max_memory_allocated()

from n46whisper.

41889732 avatar 41889732 commented on August 16, 2024

另外我有一个想法,普通gpt号好像就3个请求每分钟,可以尝试把文本集中起来翻译完成后再组装上去🤔

我在尝试实现这个功能,但是目前的问题是翻译多句话后gpt的回复格式可能不是很稳定,再分割成单句容易出问题,还需要调prompt,不知道这个功能是否需要pr?

from n46whisper.

Ayanaminn avatar Ayanaminn commented on August 16, 2024

whisperdesktop(用的新的ggmlv2模型)的结果会显示背景音、语气词、停顿,不过它的时间轴有大问题,语音结束立刻会到下一句
N46时间轴没有问题,不会显示背景音和语气词,停顿空格也几乎没有,我用的v1模型,因为v2模型没有标点符号
什么原因导致的呢?优点能结合起来就完美了

我不太懂WhisperDesktop具体C++是怎么实现的, 也不太清楚他默认参数

但是有可能是和beam size这个参数有关, 在换成faster-whisper之后我把这个参数定explicitly固定成5了。

The default beam size is 5 when using the whisper command line, but not when calling the model.transcribe method. Here the beam size defaults to None which means that greedy decoding is used.

from n46whisper.

Ayanaminn avatar Ayanaminn commented on August 16, 2024

另外我有一个想法,普通gpt号好像就3个请求每分钟,可以尝试把文本集中起来翻译完成后再组装上去🤔

我在尝试实现这个功能,但是目前的问题是翻译多句话后gpt的回复格式可能不是很稳定,再分割成单句容易出问题,还需要调prompt,不知道这个功能是否需要pr?

那太好了,可以请你先提一个?
我最近也想再优化一下翻译部分,除了改一下prompt,目前的想法是让用户自己决定按多少句分块,然后分别翻译每块最后统一输出。

from n46whisper.

souvenp avatar souvenp commented on August 16, 2024

s="""はい到着 ここを一人でお散歩する時必ず寄ってるんだ###
岩もちょうどいい形と高さで 座りやすいでしょ###
お母さんに教えてもらった場所なの 初めて連れてきてもらってから###
すっかりお気に入りになっちゃった で今度は私が連れて行く番になって###
妹たちがまだちっちゃかった頃は 必ずここまで一緒に散歩しに来てたんだよ###
"""
我发现每一句末尾加个标志就能稳定格式了,15次循环都能输出单独五行出来,不过有时会这样:
嗯,到了。我自己一個散步時一定會來這裡###
這石頭的形狀和高度很適合坐呢###
這是媽媽告訴我的地方,自從第一次被帶來後###
我就待在這裡成為自己最喜愛的地方###
當我妹妹們還很小的時候,我也必定會帶她們一起走到這裡呢。###

好的,到达了。每次一个人散步的时候都一定会来这里###

岩石的形状和高度都非常适合坐下来休息###

这是母亲教我的地方。从第一次被带来以来###

我已经完全喜欢上这个地方了,现在轮到我带他人来了###

妹妹们还很小的时候,我们总是一起散步来到这里呢###
后面处理一下字符串就行,这个问题不大。
循环输出五次效果

  • 到了,我每次独自散步时必定会来的地方。
  • 这石头形状挺好且高度也刚好,坐起来很舒服吧。
  • 是母亲教我的地方,从第一次被带来后就深深地留在了我心里。
  • 现在已经成为了我最喜欢的地方,并且该我把别人带到这里来了。
  • 在妹妹们还很小的时候,我一定会和她们一起走路到这里来。
  • 好,到了。我每次独自散步时都必须来这里。###
  • 这石头形状和高度都很舒适呢。###
  • 这是我妈妈教我的地方,自从第一次被带来以后。###
  • 现在我完全爱上这个地方了。以后到我的回合就轮到带大家来了。###
  • 在妹妹们还很小的时候,我们总是一起步行到这里。###
  • 到了,每次我一个人散步时都一定会来这里###
  • 这块石头形状和高度非常舒适###
  • 这是妈妈教我的地方,从来没来过之前###
  • 我已经完全喜欢上了这里,现在该轮到我带别人来了###
  • 在妹妹们还很小的时候,我总是带她们一起散步来这里呢###
  • 嗯,到了。每次独自散步时一定会来这里。###
  • 这个岩石的形状和高度正好适合坐。###
  • 这是我妈妈教我的地方,自从第一次被带来后,我就开始喜欢上它了。###
  • 现在它已经成为我的最爱了,我轮到带人来参观了。###
  • 在我的妹妹们还很小的时候,我们总是一起来这里散步。###
  • 到了,我每次独自散步都会来这里###
  • 岩石既有合适的形状和高度,也很容易坐###
  • 这是妈妈教给我的地方,从第一次带我来开始###
  • 我完全喜欢上这个地方了,现在该轮到我带人来了###
  • 当妹妹们还小的时候,我们总是一起散步走到这里的###
    我用的prompts:
messages=[
                    {
                        "role": "user",
                        "content": """Help me to translate Japanese to Simplify Chinese.
                                   Please do not output any text other than the translation.
                                   Translate according to the following points:
                                   1.Colloquialism and conversational, as this is a conversation, not an article.
                                   2.Translate in context of the conversation.
                                   3.Avoid stiff machine translation, try to translate in a way that reflects the
                                   emotions and intended meaning of the speaker.
                                   4.Omission of subjects, as subjects do not need to be emphasized in
                                   one-on-one conversations.
                                   5.Stick to Chinese word order and habits.
                                   Please translate them line by line. The format of the result should match 
                                   the original text, one line for one sentence. The # signs are not needed.
                                   The results should be 5 lines in total.
                                   """ + text,
                    },
                ],
                temperature=1.3,

temperature影响很大,可以自由改变比较好

from n46whisper.

Ayanaminn avatar Ayanaminn commented on August 16, 2024

我刚做了个小更新,现在可以输入自己的prompt, 也可以调节temperature

temperature影响很大,可以自由改变比较好

temperature最大值是1.0吧?我感觉设的太高也不好。

from n46whisper.

souvenp avatar souvenp commented on August 16, 2024

我刚做了个小更新,现在可以输入自己的prompt, 也可以调节temperature

temperature影响很大,可以自由改变比较好

temperature最大值是1.0吧?我感觉设的太高也不好。

是0-2,低点的话变化比较少,看个人喜好把

from n46whisper.

41889732 avatar 41889732 commented on August 16, 2024

我刚做了个小更新,现在可以输入自己的prompt, 也可以调节temperature

temperature影响很大,可以自由改变比较好

temperature最大值是1.0吧?我感觉设的太高也不好。

我提了一个pr,不过似乎是基于你最新一次更新前的版本?我感觉是不是没有必要每一次对话都重新发送prompt。
之前我尝试用特殊符号进行分割,轮次多了遇到过几句话塞到一起的情况,后来换成了数字序号(1):这样,不知道效果会不会更强一点。
字数上限的话应该也是可调的,我自己感觉每次发送1600内的字符一般不会超过token数限制。

from n46whisper.

Ayanaminn avatar Ayanaminn commented on August 16, 2024

我刚做了个小更新,现在可以输入自己的prompt, 也可以调节temperature

temperature影响很大,可以自由改变比较好

temperature最大值是1.0吧?我感觉设的太高也不好。

我提了一个pr,不过似乎是基于你最新一次更新前的版本?我感觉是不是没有必要每一次对话都重新发送prompt。 之前我尝试用特殊符号进行分割,轮次多了遇到过几句话塞到一起的情况,后来换成了数字序号(1):这样,不知道效果会不会更强一点。 字数上限的话应该也是可调的,我自己感觉每次发送1600内的字符一般不会超过token数限制。

嗯嗯,等我之后抽时间看了就合并一下

from n46whisper.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.