Human-written demonstration (OpenAssistant volunteers)· OpenAssistant (human-written)
OpenAssistant Conversations (oasst2)
how to use nn.embedding
In OpenAssistant data, “assistant” turns were written by human volunteers as demonstrations. They are not model outputs.
- User
how to use nn.embedding
- Assistant
The
nn.Embeddingmodule in PyTorch is used for converting sparse one-hot vector representations of words into dense continuous-valued vectors, also known as word embeddings. Here's how you can use it:- Initialize the
nn.Embeddinglayer with the desired number of words (num_embeddings) and the size of the word embeddings (embedding_dim):
import torch import torch.nn as nn embedding = nn.Embedding(num_embeddings, embedding_dim)- The
nn.Embeddinglayer takes in a tensor of integers as input, where each integer represents a word, and maps it to the corresponding word embedding.
inputs = torch.LongTensor([1, 2, 3, 4, 5]) embedded = embedding(inputs) print(embedded.shape) # Output: torch.Size([5, embedding_dim])Note that the input tensor must be of type
torch.LongTensorand its values must be indices into the word embeddings, not the words themselves. - Initialize the
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Identical first prompt
- Human-written demonstration (OpenAssistant volunteers)Compare side by side →
- Human-written demonstration (OpenAssistant volunteers)Compare side by side →
- Human-written demonstration (OpenAssistant volunteers)Compare side by side →
- Human-written demonstration (OpenAssistant volunteers)Compare side by side →
- Human-written demonstration (OpenAssistant volunteers)Compare side by side →
- Human-written demonstration (OpenAssistant volunteers)Compare side by side →
- Human-written demonstration (OpenAssistant volunteers)Compare side by side →
- Human-written demonstration (OpenAssistant volunteers)Compare side by side →