Comments (4)
吴恩达的课讲过的,这个没有指令微调,不懂指令,只是补全/续写罢了
比如: 法国的首都是什么?
指令微调的模型会告诉你是巴黎, 没有调过的会续写成 **的首都是什么?美国的首都是什么?日本的首都是什么?
from baichuan-7b.
这个是生成的参数问题。官方没给参数,
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
tokenizer = AutoTokenizer.from_pretrained("baichuan-7B", trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained("baichuan-7B", device_map="auto", trust_remote_code=True, torch_dtype=torch.float16)
input_text = """折木奉太郎:
寒暄省略。
我目前在贝拿勒斯(注)。日本人大多是这么称呼它吧,但感觉旧名「瓦拉纳西」的发音似乎更接近当地方言。
奉太郎,这个城市很神奇哦,简直是个葬礼之都,因为这里不停地举办葬礼,好像只要死在这里就进得了天国,有没有搞错啊?喔,听说是能脱离轮回,如成仙一般。在**得经过长年修行才能超脱,不过在这里只要死了就成。
这么说来,**人还真可怜。
虽然是迟来的祝贺,恭喜你考上高中。原来你要读的是神山啊,真没创意,不过也罢,总之恭喜你啦。
我这姐姐要给顺利考上高中的你一个建议。
加入古籍研究社吧。
古籍研究社在神高是深具传统的学艺类社团,而且,我不清楚你知不知道,它也是我待过的社团。
据说我们这个深具传统的古籍研究社已经连续三年没招到新进社员,现在社员人数挂零,如果今年还是没人加入就等同废社了。我身为古籍研究社的前社员,"""
inputs = tokenizer(input_text, return_tensors='pt')
inputs = inputs.to('cuda')
pred = model.generate(**inputs, max_new_tokens=200,do_sample = True, top_k = 3, top_p = 0.9, temperature = 0.8, repetition_penalty=1.1, length_penalty = 1.1)
print(tokenizer.decode(pred.cpu()[0], skip_special_tokens=True)[len(input_text):])
from baichuan-7b.
这个模型应该没有经过instruct tuning,需要以ICL的形式构造prompt来获得相关的回答。
from baichuan-7b.
@smartest-water
你好,下面你这个包装接口的api代码怎么写的?能提供让我借鉴一下吗
curl -X POST "http://10.20.20.221:8000/" -H 'Content-Type: application/json' -d '{"prompt": "**有什么好吃的"}'
{"response":"**有什么好吃的?\n**有什么好吃的?\n**的美食很多,有**的特色小吃,有**的特色菜,有**的特色甜点,有**的特色饮料,有**的特色水果,有**的特色海鲜,有**的特色小吃,有**的特色小吃","status":200,"time":"2023-06-15 19:06:16"}
from baichuan-7b.
Related Issues (20)
- [Question] 你好,训练分词模型的代码可以分享吗?或者有什么参考吗?
- 请问部署后,如何通过API调用?
- pretrain learning rate is le-8?
- 请问想接上下句古诗 需要怎么写提示词?
- 我要做预训练通用模型,样本数据加载这里可以给个demo数据?
- [Question] 关于数据处理的疑问
- [Question] 多GPU部署Baichuan-7B方法
- [Question] Baichuan-7B多卡GPU 原生部署、 int8 和 int4 量化部署方法
- [Question] Baichuan-7B多GPU 原生部署、 int8 和 int4 量化部署
- [Evaluation] 提供 Baichuan 模型在 OpenCompass 上的评测结果
- [Question] 请问7B没有用上FlashAttention吗? HOT 1
- 能提供个类似open_api.py的文件,可以供我们使用接口进行测试吗?
- [Question] DeepSpeed Zero3 save_checkpoint() got empty mode_states files HOT 3
- [BUG] CUDA Out of Memory when eval model. HOT 3
- [Question] 可以提供模型的国内下载源吗
- [Question] RoPE的实现和论文里不一致
- [Typo]
- 想问一下在A800上测试的吞吐量,换算到推理速度的话有多少tokens/s?
- [Question] 我想用 Baichuan-7B来开发中文文本纠错功能,主要是错别字,请问下可行性?
- [Question] Baichuan-Text-Embedding can be open for open source or have api to use or pay for use? thanks
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 baichuan-7b.