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
To use nn.Embedding in PyTorch, follow these steps:
Import nn module from PyTorch. Define an nn.Embedding layer, which maps integer-encoded words to dense vectors. Initialize the layer with the desired number of embeddings and the dimension of the embedding vectors. Pass a tensor of integer-encoded words as input to the layer. The output of the layer is the corresponding dense vector representation for each word.Example code:
import torch import torch.nn as nn # Define the embedding layer embedding = nn.Embedding(num_embeddings=10, embedding_dim=3) # Input tensor of shape (batch_size, sequence_length) input_tensor = torch.LongTensor([[1,2,3], [4,5,6]]) # Output tensor of shape (batch_size, sequence_length, embedding_dim) output = embedding(input_tensor)
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)