mirror of
https://github.com/deepseek-ai/DeepSeek-Coder.git
synced 2026-11-05 00:57:19 +00:00
[GH-ISSUE #17] 重复输出 #13
Labels
No labels
documentation
ENV
pull-request
research question
WIP
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
deepseek-ai/DeepSeek-Coder#13
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @gafield-liu on GitHub (Nov 7, 2023).
Original GitHub issue: https://github.com/deepseek-ai/DeepSeek-Coder/issues/17
请问下,代码补全中模型经常出现说不停的情况,你们有发现类似的情况么?
@guoday commented on GitHub (Nov 7, 2023):
请问是什么规模的模型(1b,7b,33b),用了什么类型的模型(base, instruct),大概补全了多少行
@gafield-liu commented on GitHub (Nov 7, 2023):
33b base, 6.7b base模型,case是50行左右。
@gafield-liu commented on GitHub (Nov 7, 2023):
测了一些例子,6.7b模型大概有30%的概率,会输出不停~
@guoday commented on GitHub (Nov 7, 2023):
输出不停是指无法遇到还是说会重复输出同样的代码?
@guoday commented on GitHub (Nov 7, 2023):
你可以试下Repetition penalty设为1.1,我们在使用补全插件的过程中,Repetition penalty设为1.1,体验会好一些
@gafield-liu commented on GitHub (Nov 7, 2023):
类似这个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
}
}
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:
@pkuzqh commented on GitHub (Nov 7, 2023):
训练的时候fim确实会随机剪开文件拼在一起,因此有时候会出现补全比较长的情况,如果是使用成补全的话,最好设置最大长度
@gafield-liu commented on GitHub (Nov 7, 2023):
嗯嗯明白,似乎没找到一种合适的配置,可以让模型补全的比较稳定~
试过了codellama的补全功能也有类似的情况。
@guoday commented on GitHub (Nov 7, 2023):
我们一般使用fim的话,会用Repetition penalty为1,然后限制补全最多3行或遇到eos。如果要继续补全,就再过一次fim
@gafield-liu commented on GitHub (Nov 7, 2023):
收到,感谢回复~