Coder Social home page Coder Social logo

重复输出 about deepseek-coder HOT 10 CLOSED

gafield-liu avatar gafield-liu commented on August 22, 2024
重复输出

from deepseek-coder.

Comments (10)

guoday avatar guoday commented on August 22, 2024

请问是什么规模的模型(1b,7b,33b),用了什么类型的模型(base, instruct),大概补全了多少行

from deepseek-coder.

gafield-liu avatar gafield-liu commented on August 22, 2024

33b base, 6.7b base模型,case是50行左右。

from deepseek-coder.

gafield-liu avatar gafield-liu commented on August 22, 2024

测了一些例子,6.7b模型大概有30%的概率,会输出不停~

from deepseek-coder.

guoday avatar guoday commented on August 22, 2024

输出不停是指无法遇到还是说会重复输出同样的代码?

from deepseek-coder.

guoday avatar guoday commented on August 22, 2024

你可以试下Repetition penalty设为1.1,我们在使用补全插件的过程中,Repetition penalty设为1.1,体验会好一些

from deepseek-coder.

gafield-liu avatar gafield-liu commented on August 22, 2024

类似这个case
<|fim▁begin|>
package com.vitorpamplona.amethyst

import android.app.PendingIntent
import android.content.Context
import android.content.Intent
import android.util.LruCache
import androidx.core.net.toUri
import androidx.media3.common.C
import androidx.media3.common.Player
import androidx.media3.common.Player.STATE_IDLE
import androidx.media3.common.Player.STATE_READY
import androidx.media3.exoplayer.ExoPlayer
import androidx.media3.session.MediaSession
import com.vitorpamplona.amethyst.ui.MainActivity
import kotlinx.coroutines.DelicateCoroutinesApi
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch
import kotlin.math.abs

class MultiPlayerPlaybackManager(
private val dataSourceFactory: androidx.media3.exoplayer.source.MediaSource.Factory? = null,
private val cachedPositions: VideoViewedPositionCache
) {
// protects from LruCache killing playing sessions
private val playingMap = mutableMapOf<String, MediaSession>()

private val cache =
object : LruCache<String, MediaSession>(10) { // up to 10 videos in the screen at the same time
override fun entryRemoved(
evicted: Boolean,
key: String?,
oldValue: MediaSession?,
newValue: MediaSession?
) {
<|fim▁hole|>
}
}

private fun getCallbackIntent(callbackUri: String, applicationContext: Context): PendingIntent {
return PendingIntent.getActivity(
applicationContext,
0,
Intent(Intent.ACTION_VIEW, callbackUri.toUri(), applicationContext, MainActivity::class.java),
PendingIntent.FLAG_IMMUTABLE or PendingIntent.FLAG_UPDATE_CURRENT
)
<|fim▁end|> if (evicted) {
oldValue?.release()
}
}
}

fun getSession(
videoUrl: String,
applicationContext: Context,
callbackUri: String,
onPlayerReady: (MediaSession) -> Unit
): MediaSession {
val session = cache.get(videoUrl)
if (session != null) {
return session
}

val newSession = MediaSession(applicationContext, videoUrl)
newSession.setCallback(object : MediaSession.Callback() {
    override fun onPlay() {
        super.onPlay()
        playingMap[videoUrl] = newSession
    }

    override fun onPause() {
        super.onPause()
        playingMap.remove(videoUrl)
    }
})

newSession.setMediaButtonEventReceiver(getCallbackIntent(callbackUri, applicationContext))

newSession.setPlaybackToLocal()
newSession.setRatingType(C.RATING_TYPE_NONE)
newSession.setPlayWhenReady(true)

val player = ExoPlayer.Builder(applicationContext).build()
player.addListener(object : Player.Listener {
    override fun onPlaybackStateChanged(playbackState: Int) {
        if (playbackState == STATE_READY) {
            onPlayerReady(newSession)
        }
    }
})

newSession.setPlayer(player)
newSession.setMediaSource(dataSourceFactory?.createMediaSource(videoUrl.toUri()))

cache.put(videoUrl, newSession)

return newSession

}

fun release(videoUrl: String) {
cache.remove(videoUrl)
}

fun releaseAll() {
cache.evictAll()
}

fun getPlayingSession(): MediaSession? {
return playingMap.values.firstOrNull()
}

fun getPlayingSession(videoUrl: String): MediaSession? {
return playingMap[videoUrl]
}

fun getPlayingSession(videoUrl: String, onPlayerReady: (MediaSession) -> Unit) {
val session = playingMap[videoUrl]
if (session != null) {
onPlayerReady(session)
}
}

fun getPlayingSession(videoUrl: String, onPlayerReady: (MediaSession) -> Unit, onPlayerNotReady: () -> Unit) {
val session = playingMap[videoUrl]
if (session != null) {
onPlayerReady(session)
} else {
onPlayerNotReady()
}
}

fun getPlayingSession(videoUrl: String, onPlayerReady: (MediaSession) -> Unit, onPlayerNotReady: () -> Unit, onPlayerError: () -> Unit) {
val session = playingMap[videoUrl]
if (session != null) {
onPlayerReady(session)
} else {
onPlayerNotReady()
}
}

fun getPlayingSession(videoUrl: String, onPlayerReady: (MediaSession) -> Unit, onPlayerNotReady: () -> Unit, onPlayerError: () -> Unit, onPlayerIdle: () -> Unit) {
val session = playingMap[videoUrl]
if (session != null) {
onPlayerReady(session)
} else {
onPlayerNotReady()
}
}

fun getPlayingSession(videoUrl: String, onPlayerReady: (MediaSession) -> Unit, onPlayerNotReady: () -> Unit, onPlayerError: () -> Unit, onPlayerIdle: () -> Unit, onPlayerEnded: () -> Unit) {
val session = playingMap[videoUrl]
if (session != null) {
onPlayerReady(session)
} else {
onPlayerNotReady()
}
}

fun getPlayingSession(videoUrl: String, onPlayerReady: (MediaSession) -> Unit, onPlayerNotReady: () -> Unit, onPlayerError: () -> Unit, onPlayerIdle: () -> Unit, onPlayerEnded: () -> Unit, onPlayerBuffering:

from deepseek-coder.

pkuzqh avatar pkuzqh commented on August 22, 2024

训练的时候fim确实会随机剪开文件拼在一起,因此有时候会出现补全比较长的情况,如果是使用成补全的话,最好设置最大长度

from deepseek-coder.

gafield-liu avatar gafield-liu commented on August 22, 2024

嗯嗯明白,似乎没找到一种合适的配置,可以让模型补全的比较稳定~
试过了codellama的补全功能也有类似的情况。

from deepseek-coder.

guoday avatar guoday commented on August 22, 2024

我们一般使用fim的话,会用Repetition penalty为1,然后限制补全最多3行或遇到eos。如果要继续补全,就再过一次fim

from deepseek-coder.

gafield-liu avatar gafield-liu commented on August 22, 2024

收到,感谢回复~

from deepseek-coder.

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.