I tried to make a simple text generation tool.
This is my code:
from transformers import pipeline
pipe = pipeline('text-generation', model='dbmdz/german-gpt2', tokenizer='dbmdz/german-gpt2', config={'max_length': 800})
text = pipe("Der Sinn des Lebens ist es")[0]['generated_text']
print(text)
When i try to run it i get the following error:
2021-11-04 18:56:13.996698: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'cudart64_110.dll'; dlerror: cudart64_110.dll not found
2021-11-04 18:56:13.996798: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
Traceback (most recent call last):
File "D:\Projects\Coding\VoiceAssistant\Moduls\TextGeneration\main.py", line 3, in <module>
pipe = pipeline('text-generation', model='dbmdz/german-gpt2', tokenizer='dbmdz/german-gpt2', config={'max_length': 800})
File "C:\Users\lukas\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\transformers\pipelines\__init__.py", line 462, in pipeline
framework, model = infer_framework_load_model(
File "C:\Users\lukas\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\transformers\pipelines\base.py", line 118, in infer_framework_load_model
if config.architectures:
AttributeError: 'dict' object has no attribute 'architectures'
My Python Version: 3.9.7 My Windows version: Win11 Pro