Questions tagged [text-generation]

27 questions
0
votes
0 answers

While trying to generate text using GPT-2 the custom loss function accesses PAD_TOKEN_ID

While training the custom loss function tries to access the PAD_TOKEN_ID resulting in the below error.50257 is the PAD_TOKEN_ID and the vocab size of GPT-2 InvalidArgumentError: {{function_node…
S_2010
  • 1
  • 1
0
votes
0 answers

How can I make a tensorflow based Text-generating AI?

I'm working on a 'AI chatbot' that relates inputs from user to a json file, to return an 'answer', also pre-defined. But the question is that I want to add text-generating function, and I don't know how to do so(in python).I tried before but didn't…
0
votes
0 answers

Input 0 of layer "dense_22" is incompatible with the layer: expected axis -1 of input shape to have value 100, but received input with shape (100, 1)

def addSpaces(text, minLength): while(len(text) < minLength): text += " " return text def convertToTokens(text): return [ord(token) for token in text] def buildExamples(text, paddedLength): trainExamples = [] for i in…
0
votes
0 answers

how to fix "KeyError: 0" in the hugging face transformer train() function

hello guys please i am in dying need of your help . i am trying to fine-tune the gpt2-meduim model with the hugging face transformer and i ran into this error just when i wanted to start the training "KeyError: 0" . here is my full code import…
0
votes
0 answers

Evaluation metric for feedback generation?

I am newbie in NLP I am working on generating feedback for students answer and wondering what would be best evaluation metric for this case? my dataset consists of tuples, I am planning to use flan-t5 with prompting (where you add several…
HelloWorld
  • 77
  • 3
  • 9
0
votes
0 answers

Trouble with running on GPU in MXNet

I am reproduce code at https://github.com/cartus/dcgcn in Colab. But there is an error when using GPU. Meanwhile, if I use CPU, this error does not appear. Is there any solution ? Note: I use mxnet_cu116 and cuda version: 12.0 Thank…
0
votes
0 answers

How does text for HLLs appear on the screen? What translates the letters into pixels? Which hardware knows how to use the patterns for them?

And if you didn't have C or another human language, how would you tell a system to generate text on a screen after working out the specifics of the language you want to create without the help of another? If someone wanted to write a compiler for a…
0
votes
0 answers

How to generate sentences using deeplearning4j?

I'm trying to generate new sentences based on a set of existing sentences using deeplearning4j. What would be the best way to approach this using deeplearning4j? Could anyone provide an example of how to create a simple sentence generation model…
0
votes
0 answers

Deep learning NLlP Keras: TextVectorization IndexError: tuple index out of range

After cleaning the text, i am trying to vectoriz the text then i am getting the following error: "tuple index out of range" I am not sure if I am doing something wrong? Please your help. Thank you in advance from __future__ import…
Maik
  • 11
  • 2
0
votes
0 answers

Converting generative transformer model from keras to PyTorch

I would like to re-create the following keras model in PyTorch. vocab_size = 22 maxlen = 200 embed_dim = 256 num_heads = 2 feed_forward_dim = 256 batch_size = 128 decoders = 5 def create_model(): inputs = layers.Input(shape=(maxlen,),…
0
votes
1 answer

Determining the probability of a sequence generated by T5 model by HuggingFace

I am using T5-Large by HuggingFace for inference. Given a premise and a hypothesis, I need to determine whether they are related or not. So, if I feed a string "mnli premise: This game will NOT open unless you agree to them sharing your information…
-1
votes
0 answers

Updating custom output layers of an LSTM network

I have a text generation task learning to predict the next word with an LSTM network with multiple output layers. After the generation of a sentence has finished, I calculate a reward for the whole sentence and try to update the output layers…
1
2