Comments (3)
I have the same problem while generating text with the model.
Firstly it requires num_beams and after it's set, AttributeError: 'NoneType' object has no attribute 'tolist' appears like in the post above.
Please fix or provide comments on how to resolve it
from ru-gpts.
Hey @LEv145 , thank you for bringing that up!
The num_beams
parameter refers to the beam search decoding strategy for the model: see HuggingFace explanation
Try to pass in to the generation function as an argument, or stick to sampling or greedy generation
The parameters can be found in the generate
function in xl_wrapper script
from ru-gpts.
Hey @LEv145 , thank you for bringing that up!
The
num_beams
parameter refers to the beam search decoding strategy for the model: see HuggingFace explanation Try to pass in to the generation function as an argument, or stick to sampling or greedy generationThe parameters can be found in the
generate
function in xl_wrapper script
Thanks it works!
But there is a problem when processing the result:
Load checkpoint from /mnt/store/models/rugpt3xl/mp_rank_00_model_states.pt
Model Loaded
Traceback (most recent call last):
File "/mnt/store/tests/test_rugpt3xl.py", line 29, in <module>
main()
File "/mnt/store/tests/test_rugpt3xl.py", line 19, in main
result = gpt.generate(
File "/opt/ru-gpts/src/xl_wrapper.py", line 244, in generate
return list(map(self.tokenizer.decode, res.tolist()))
AttributeError: 'NoneType' object has no attribute 'tolist'
Code
import os
import sys
sys.path.append("/opt/ru-gpts/")
os.environ["USE_DEEPSPEED"] = "1"
os.environ["MASTER_ADDR"] = "127.0.0.1"
os.environ["MASTER_PORT"] = "5000"
from src.xl_wrapper import RuGPT3XL
def main():
gpt = RuGPT3XL.from_pretrained(
"sberbank-ai/rugpt3xl",
weights_path="/mnt/store/models/rugpt3xl/mp_rank_00_model_states.pt",
seq_len=512,
)
result = gpt.generate(
"Кто был президентом США в 2020? ",
max_length=50,
num_beams=5,
early_stopping=True,
)
print(result)
if __name__ == "__main__":
main()
from ru-gpts.
Related Issues (20)
- describe carbon emission
- ruGPT3XL_generation.ipynb not working HOT 3
- Новость курс
- AssertionError: model parallel group is not initialized HOT 1
- Ru-gpts for chit-chat bot HOT 2
- Прямая трансляция по apex legends HOT 1
- Games
- Correct data format for fine-tuning RUGPT3 models
- A
- The XL Model and the latest DeepSpeed
- Как настроить на вопрос\ответ? HOT 2
- Apackage missing HOT 2
- Repository not found HOT 1
- Are there hardware requirements to execute the script? HOT 17
- Ускорение инференса rugpt3-large HOT 1
- Как embedding'и получить и какой они длины? HOT 1
- Unable to use RuGPT3FinetuneHF.ipynb Colab notebook HOT 1
- Link to code implementation is not available
- No "nvcc" utilite founded during environment installation 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 ru-gpts.