Comments (7)
我用的模型是RWKV-4-World-CHNtuned-3B-v1-20230625-ctx4096.pth,也转换过RWKV-4-World-CHNtuned-3B-v1-20230625-ctx4096-fp16.bin,都测试过,即使修改代码backend-python\routes\completion.py下的设置,重启程序也不生效,是这个模型不支持吗
class ChatCompletionBody(ModelConfigBody):
messages: Union[List[Message], None]
model: Union[str, None] = "rwkv"
stream: bool = False
stop: Union[str, List[str], None] = default_stop
user_name: Union[str, None] = Field(
None, description="Internal user name", min_length=1
)
assistant_name: Union[str, None] = Field(
None, description="Internal assistant name", min_length=1
)
system_name: Union[str, None] = Field(
None, description="Internal system name", min_length=1
)
presystem: bool = Field(
True, description="Whether to insert default system prompt at the beginning"
)
model_config = {
"json_schema_extra": {
"example": {
"messages": [
{"role": Role.User.value, "content": "hello", "raw": False}
],
"model": "rwkv",
"stream": False,
"stop": None,
"user_name": None,
"assistant_name": None,
"system_name": None,
"presystem": True,
"max_tokens": 1000,
"temperature": 1,
"top_p": 0.3,
"presence_penalty": 0,
"frequency_penalty": 1,
}
}
}
class CompletionBody(ModelConfigBody):
prompt: Union[str, List[str], None]
model: Union[str, None] = "rwkv"
stream: bool = False
stop: Union[str, List[str], None] = None
model_config = {
"json_schema_extra": {
"example": {
"prompt": "The following is an epic science fiction masterpiece that is immortalized, "
+ "with delicate descriptions and grand depictions of interstellar civilization wars.\nChapter 1.\n",
"model": "rwkv",
"stream": False,
"stop": None,
"max_tokens": 100,
"temperature": 1,
"top_p": 0.3,
"presence_penalty": 0,
"frequency_penalty": 1,
}
}
}
from rwkv-runner.
好像每次程序都会重置修改的参数,那个流式参数是不能修改吗
from rwkv-runner.
模型用 https://huggingface.co/BlinkDL/rwkv-6-world/blob/main/RWKV-x060-World-3B-v2.1-20240417-ctx4096.pth
另外显存多少?显存够就解码参数选 cuda fp16
from rwkv-runner.
12g的显存
from rwkv-runner.
@zhuifengzl 参数是调用api的时候传递的, 可以改, 你不用去改源码, 载入模型的时候, 拉满"载入显存层数"
from rwkv-runner.
好的,我试试,感谢哈
from rwkv-runner.
public struct LocalSendData
{
public string model;
public bool stream;
public bool presystem;
public int max_tokens;
public double temperature;
public double top_p;
public double presence_penalty;
public double frequency_penalty;
public List messages;
}
public struct LocalSendDataMes
{
public string role;
public string content;
public bool raw;
}
public static IEnumerator RequestGPTSegmentation_local(string content, Action<string, bool> callback)
{
string postData = "";
//Debug.Log("postData");
LocalSendData local = new LocalSendData();
local.model = "rwkv";
local.stream = false;
local.presystem = true;
local.max_tokens = 10000;
local.temperature = 1.2;
local.top_p = 0.5;
local.presence_penalty = 0.4;
local.frequency_penalty = 0.4;
local.messages = new List<LocalSendDataMes>();
local.messages.Add(new LocalSendDataMes() { role = "user", content = content, raw = false });
postData = JsonMapper.ToJson(local);
Debug.Log(postData);
//Debug.Log(ConfigExcelMgr.instance.excelData.str_localPath);
using (var request = new UnityWebRequest(ConfigExcelMgr.instance.excelData.str_localPath + "/chat/completions", "POST"))
//using (var request = new UnityWebRequest("http://192.168.0.105:8000/chat/completions", "POST"))
{
request.SetRequestHeader("Accept", "application/json, text/plain, */*");
request.SetRequestHeader("Content-Type", "application/json");
request.uploadHandler = new UploadHandlerRaw(Encoding.UTF8.GetBytes(postData));
request.downloadHandler = new DownloadHandlerBuffer();
UnityWebRequestAsyncOperation asyncOp = request.SendWebRequest();
int dataIndex = 0;
string text = "";
while (!asyncOp.isDone)
{
//Disponse(false);
yield return wait_internal;
}
if (request.result == UnityWebRequest.Result.ConnectionError || request.result == UnityWebRequest.Result.ProtocolError)
{
Debug.LogError("Error: " + request.error);
}
//Debug.Log(request.downloadHandler.text);
if (request.downloadHandler.text != null)
{
string jsondata = request.downloadHandler.text;
JsonData jd = JsonMapper.ToObject(jsondata);
//string js_finish_reason = (string)jd["choices"]["finish_reason"];
string js_text = (string)jd["choices"][0]["message"]["content"];
callback?.Invoke(js_text, true);
}
这是写的代码,我不太懂,帮忙看看应该怎么修改,才能提高接口的回答速度呢
from rwkv-runner.
Related Issues (20)
- 能不能加个深浅色模式自动跟随系统外观 HOT 2
- MacOS版本的停止按钮失效? HOT 1
- 切换.bin模型失败 HOT 6
- Trojans in Windows installer? (multiple detections from VirusTotal) HOT 1
- 我在本地配置了ollama,在聊天和续写时怎么调取? HOT 6
- 希望加入PISSA和LISA微调 HOT 2
- 【新人求助】如果想写小说,有什么模型推荐? HOT 1
- Win10 無法啟動 HOT 4
- CPU/CPU(rwkv.cpp) 模型切换问题 HOT 1
- 大佬,有兴趣加入Mirostat采样器吗? HOT 1
- 如何完全卸载呢? HOT 1
- 希望重新生成之前的对话时不会自动滚动到最后一段聊天
- JosStorer君,下载的东西都默认下载到C盘了。文件夹我是放到D盘的 HOT 1
- 模型运行成功,但发的所有消息都显示network error,控制台显示报错。 HOT 2
- 微调功能在上月新发布的 ubuntu 24.04 下失败
- 是否能够进行多batch的推理?
- install from source requirement.txt error on pkgutil
- 服务启动成功,但是访问报500 HOT 3
- 显卡能使用计算卡吗?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rwkv-runner.