Giter VIP home page Giter VIP logo

Comments (7)

hazy217 avatar hazy217 commented on May 17, 2024

我也遇到了类似的问题,感觉输出大部分时间都不太符合预期

from baichuan-7b.

Nisoka avatar Nisoka commented on May 17, 2024

能否提供一个脚本参数,让模型正常起来

from baichuan-7b.

expresschen avatar expresschen commented on May 17, 2024

遇到同样的问题

from baichuan-7b.

zmsn-2077 avatar zmsn-2077 commented on May 17, 2024

推理代码:

from transformers import AutoModelForCausalLM, AutoTokenizer

tokenizer = AutoTokenizer.from_pretrained("/home/user/models/pre/baichuan-7b", trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained("/home/user/models/pre/baichuan-7b", device_map="auto", trust_remote_code=True)
inputs = tokenizer('登鹳雀楼->王之涣\n夜雨寄北->', return_tensors='pt')
inputs = inputs.to('cuda:0')
pred = model.generate(**inputs, max_new_tokens=64)
print(tokenizer.decode(pred.cpu()[0], skip_special_tokens=True))

the output:
image

from baichuan-7b.

shibing624 avatar shibing624 commented on May 17, 2024
image 不完全一致

from baichuan-7b.

SHENbeyond avatar SHENbeyond commented on May 17, 2024

@yucc-leon @expresschen 结尾不要\n

from baichuan-7b.

yucc-leon avatar yucc-leon commented on May 17, 2024

image
image
看来部分输出是符合预期的,但需要做一些限制。

from baichuan-7b.

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.