Sources
Add documents and examples to a project from files, pasted text or a Hugging Face dataset.
Sources are what a project learns from. They come in two kinds:
- Documents, such as manuals, policies or articles. You turn them into examples by generating examples.
- Examples you already have: question and answer pairs, whole conversations, or DPO preference pairs with chosen and rejected answers. They go to Review, approved already when they pass the quality checks, if you choose.
A decision project imports neither: it imports cases, as typed decisions (a state, its questions and their gold answers) or as labelled texts (a text and its label). See Decision projects.
Each upload, paste and Hugging Face import is listed as one import on the Sources page (under Data in the sidebar). What you import is kept in your organization's connected storage: a RunPod network volume or an S3-compatible bucket. See Connections.
Before you start
- You are a member or an owner. Viewers can only look.
- Your organization has its storage connected. See Connections.
- Text files are UTF-8. Scanned PDFs need OCR first: only a PDF's text layer is read.
- For a private or gated Hugging Face dataset, an owner has added a Hugging Face token that can read it.
- For images, the project uses a vision model. Import new images from a Hugging Face dataset; preference rows can also reference images already in your organization's storage. See Shared image prompts.
How imports count
Dataset imports are unlimited on every organization. Everything you upload or paste while the Add sources window is open is one import, listed as one on Sources: up to 20 files within an hour. A Hugging Face import is one import too.
Every organization has a limit on the rows one import reads and the examples a project holds: 500,000 and 2,000,000. The rows of an uploaded file or paste, or of a Hugging Face import from its starting row, count whatever they become; no import reads more than 5,000,000 at a time. An upload that would take the project past its examples adds nothing. A Hugging Face import adds its rows a page at a time and stops at the page that would; the rows it added stay. See Limits on every organization.
Add sources
Choose Add sources. The dialog has three tabs: Upload files, Paste content and Hugging Face.
Upload files
- On Upload files, choose up to 20 files.
- Check what the console found. It reads the first rows of a JSON Lines, JSON, CSV or TSV file at once and says what they are, such as "Detected: 1,240 prompt and answer examples (instruction → question, output → answer)". Other formats are read when you import them. See Map columns.
- Under Use these sources for, choose Training and validation or Test (held out). See Training or evaluation.
- For examples, keep Approve examples that pass checks ticked, or untick it to approve them all yourself. See Approve examples as you import.
- Choose Import files.
Each file is imported whole or not at all. When every file is imported whole, the dialog closes and a notice says what was added, such as "2,000 examples ready to review" with Open Review, "1,800 examples added · 1,750 approved, 50 to review", or "3 documents added" with Generate examples. If nothing was new, it says "Nothing new: every row is already in this project".
If a file fails or rows are skipped, the dialog stays open with each file's import report. Fix a failed file and import it again: while the dialog stays open, it is still the same import.
Paste content
- On Paste content, enter a Source name and paste into Content.
- Format starts at Detect: JSON, JSON Lines, and CSV or TSV whose first line names known columns, such as
question,answer, are read as such, and anything else as plain text. The option shows what was detected, such as "Detect (JSONL)". Choose a format yourself to override it. - Choose what to Use these sources for, whether to Approve examples that pass checks, and the column mapping if needed.
- Choose Import pasted content.
The paste is read like an uploaded file of that format, and pasted examples show what was detected, as files do.
Import from Hugging Face
- On Hugging Face, enter the dataset's address or ID under Hugging Face dataset URL or ID, such as
https://huggingface.co/datasets/secemp9/arxiv-complete, and choose Load dataset. - The Subset and Split start at the recommended ones, and the recommended subset is marked Recommended. For arXiv,
paper_textis recommended instead offiles. Check them, and set Start at row (0, the first row, by default). - The first rows load by themselves. First rows shows up to five, with the number of rows in the split, and notes about the suggested mapping appear above them.
- Check the mapping. See the suggested mapping below, and Map columns.
- Optionally open Filter and sample (optional). See Filter and sample below.
- Rows to import is the whole split from the starting row. Type a number to import fewer; All N (Up to N with filters or sampling) brings back the whole split.
- Choose what to Use these rows for. See below.
- For examples, keep or untick Approve examples that pass checks.
- Choose Import N rows, or Import up to N rows with filters or sampling.
The import runs in the background; follow it in Activity. Rows that arrive stay imported: Cancel keeps them, and Retry on a failed or cancelled import carries on where it stopped.
With your organization's own connections, one import brings in up to your organization's rows per import (500,000, and never more than 5,000,000): the rows go to your own storage. On shared connections, one import brings in up to 5,000 rows. Start another import at a later row for more.
If Hugging Face converted only part of a very large dataset, the preview says so: rows past that part can't be imported.
The preview pins the revision of its rows. If the rows or their Parquet export change on Hugging Face before or during the import, it stops rather than mixing revisions: load the dataset again and start a new import.
Use these rows for decides where the rows go in every version:
- From a split named
train(or any name not below), you choose Training and validation or Test (held out). - A split named
validation,valid,valordevalways goes to Validation, andtest,evalorevaluationalways to Test (held out), also with a suffix such astest_v2. The field then says "A validation or test split stays held out."
Rows for Test (held out) are held-out evaluation data. Each row keeps its split from then on.
Note
If every example comes from a train split imported for Training and validation, a version has no test examples. Import the dataset's test split too, or another range of rows for Test (held out).
Images. With Import as set to Prompt and answer examples, Chat conversations (messages or ShareGPT) or Preference pairs for DPO, an Image column (optional) field appears. It works only in a vision model's project. Preference pairs share their prompt images across both answers. See Vision models.
The suggested mapping
The preview suggests a mapping from the dataset's column names, in any case, the same way uploads are read. See How rows are recognized. In addition, a primary_category, category, categories, topic or label column becomes the category, or the first item of a list.
If no column fits, the preview says "No standard text, prompt/answer, or conversation column was detected…": map the columns yourself or choose another subset. In a vision model's project, the suggestion includes the dataset's image column.
If a row under First rows is marked "shortened here; imported in full", Hugging Face shortened a very long cell for the preview. The import reads the whole cell.
Filter and sample
- Under Choose rows, First matching rows checks rows from the starting row on. Reproducible random sample draws from the starting row to the end of the split with the Random seed: the same revision, starting row, seed and settings choose the same rows.
- Add category filter, Add language filter and Add text length filter add a filter: set its column and Condition. Every filter must match.
- Equals any of takes comma-separated values, exact and case-sensitive. A list column matches if any of its items is listed.
- Characters: at least and Characters: at most count the characters of a text column's full text, not model tokens. Number: at least and Number: at most work on numeric columns.
- With filters, Rows to check at most bounds the check, which can find fewer matches than you asked for: broaden the filters or check more rows.
For example, select paper_text for arXiv, map text as documents, filter primary_category to cs.AI, cs.LG, choose a random sample with seed 42, and import up to 1,000 rows within a 10,000-row check. The result may contain fewer than 1,000 papers if too few rows match.
The rows under First rows are unfiltered. Rows are selected before any is imported: Activity shows how many were checked and matched, then the import's progress. Cancel and Retry keep the selection.
Filtering and sampling need a split that Hugging Face converted completely. See Limits for how many rows they check and select.
Approve examples as you import
Approve examples that pass checks is ticked by default whenever an import brings examples. Examples that pass the quality checks are then approved as they arrive, and those with a flag wait in Review as pending:
- a possible email address or phone number;
- an empty answer, or a very short one (a prose answer under 12 characters);
- content over 20,000 characters;
- repeated sentences;
- a different answer to the same question, already approved or in the same import.
Documents are never approved: you generate examples from them. Untick the box to review every example yourself. An approved example can still be rejected or changed later in Review.
File formats
| Format | Extensions | What it becomes |
|---|---|---|
| Plain text, Markdown | .txt, .md, .markdown |
One document |
| HTML | .html, .htm |
One document, visible text only (no scripts, navigation, footers or forms) |
.pdf |
One document, a section per page | |
| Word | .docx |
One document, body text and tables only (no images, headers or footnotes) |
| CSV, TSV | .csv, .tsv |
One source per row; the first line holds the headings |
| Excel | .xlsx |
One source per row of every worksheet, or the one named in Excel worksheet (optional); the first row holds the headings |
| JSON Lines | .jsonl, .ndjson |
One source per line |
| JSON, YAML | .json, .yaml, .yml |
One source per item of a list, or one for a single record |
- Text formats must be UTF-8.
- PDFs, Word and Excel files must not be password-protected or encrypted. PDF reading order is best effort, so check tables and columns.
- CSV, TSV and Excel need unique, nonempty headings. In Excel, replace formulas and error cells with values first.
- YAML anchors and aliases are not supported.
Under the file picker, the dialog shows two small examples of rows it accepts.
Map columns
Open Column mapping in the dialog. It says "found by the column names" until you change it, then "set by you". Import as decides how each row is read:
| Import as | A row becomes | Columns you can name |
|---|---|---|
| Detect from the column names (default) | A conversation, an example or a document, as the column names say. See How rows are recognized. | Category column (optional) |
| Prompt and answer examples | One user message and one assistant answer | Question column, Answer column, Context column (optional), System prompt column (optional), Category column (optional), and Image column (optional) for Hugging Face |
| Chat conversations (messages or ShareGPT) | A conversation | Conversation column, Category column (optional), and Image column (optional) for Hugging Face |
| Preference pairs for DPO | A shared prompt with a chosen and a rejected text answer | Shared prompt column, Chosen answer column (preferred), Rejected answer column (less preferred), Category column (optional), and Image column (optional) for Hugging Face |
| Documents to generate examples from | A document | Text column, Category column (optional) |
- A column field left empty is found by its name, in any case: it shows "Found by name". An optional field left empty ("None") isn't used. The fields suggest the file's own column names.
- Nested paths work, such as
answers.text.0: dots step into objects and numbers pick list items, from 0. - Context is added after the question, separated by a blank line; a row without one asks the question alone. System prompt becomes a system message.
- Ordinary text columns accept text, numbers or true/false. For an object or list, name a path to the text inside. Chat columns accept message arrays; preference columns accept strings or the message arrays described in DPO preference training.
- A
categorycolumn is read without mapping. Categories show in Review and in a version's coverage.
After you change the mapping, the console checks it against the same first rows and says what it now finds.
How rows are recognized
Column names match in any case, so Question, QUESTION and question are the same:
- Preference pairs:
prompt,chosenandrejected. The shared prompt ends in a user turn; each candidate is one different, nonempty assistant text answer. Full conversations in candidate columns need to be separated into shared prompt and final answers first. See DPO preference training. - Conversations: a
messagesorconversationscolumn. In a CSV, the cell can hold the conversation as JSON. - Prompt and answer examples: the first pair the rows have, in this order:
instructionwithoutput,instructionwithresponse,promptwithcompletion,promptwithresponse,questionwithanswer,questionwithresponse, orinputwithoutput. Aninputorcontextcolumn not used in the pair becomes Context, so Alpaca's instruction, input and output work as they are. Asystemorsystem_promptcolumn becomes the system message. - Documents: otherwise, the first of
text,content,document,body,article,full_text,paper_text,reviewandabstractthat holds text.
If nothing fits, the import is refused with "No row can be used: no conversation, question and answer, or text column was found. Its columns are …": choose Import as and name the columns.
A conversation is a list of messages with role (system, user or assistant) and content. ShareGPT's from and value work too, with human or user read as the user and gpt, assistant or model as the assistant, in any case. It must have 2 to 100 messages, start with an optional system message, then alternate user and assistant, starting with user and ending with assistant. In the role and content form, a conversation is skipped if one of its messages has other fields, such as tool calls. A conversation ending in an unanswered user message is kept up to its last answer and counted as repaired.
Two examples as JSON Lines:
{"messages": [{"role": "user", "content": "How do I reset my password?"}, {"role": "assistant", "content": "Open Settings, choose Security, then choose Reset password."}], "category": "account"}
{"question": "How long do refunds take?", "answer": "Refunds reach your card within 5 business days.", "category": "billing"}The same question and answer as CSV:
question,answer,category
How long do refunds take?,Refunds reach your card within 5 business days.,billingRows already in the project are counted as duplicates and not added again, so importing the same file twice adds nothing. Preference-pair identity includes the rejected answer: changing that candidate produces a different pair, while shared prompts still keep related pairs in one split group.
Decision projects
In a decision project, Import as offers two choices, and the import takes rows only: JSON Lines, JSON, CSV, TSV, YAML or Excel.
| Import as | A row becomes | Columns you can name |
|---|---|---|
| Typed decisions · state, questions, gold | A case: its state, its questions by identifier and the gold of each | State column, Questions column, Gold column, Category column (optional) |
| Labelled texts · a text and its label | A case with one choice question over the import's Labels | Text column, Label column, Category column (optional), and the Labels, Question identifier (optional) and Instructions (optional) |
Rows with state, questions and gold columns are proposed as typed decisions, with a workflow column as the category. Preview of the first N rows. The import checks every row. shows the cases as the mapping reads them. Approve the cases as they arrive approves every case that can be used, since a case has no quality checks. A row that can't be used is skipped with its reason, which names question identifiers and never your text. See Prepare your data.
Training or evaluation
Use these sources for sets the purpose of a whole upload or paste:
- Training and validation: examples are split when you create a version. Most go to training, some to validation and test.
- Test (held out): examples always go to test, never to training. Use it for a test set you wrote or collected separately. Examples generated from these sources are held out too.
The same text can't be imported for both purposes. For Hugging Face imports, Use these rows for sets the purpose instead.
The import report
Each file, and each Hugging Face import in Activity, reports counts such as "Imported 172 · 14 duplicates · 12 repaired · 2 skipped":
| Count | Meaning |
|---|---|
| Imported | New sources added |
| Duplicates | Already in the project, not added again |
| Repaired | Conversations whose unanswered last user message was dropped |
| Skipped | Rows that could not be used |
Below the counts, each reason is listed once with its rows (row, sheet, line or item number), up to 50 rows for each file or Hugging Face import. Rows of a Hugging Face import link to the dataset viewer. If no row of a file can be used, the whole file is refused with "No row can be used:" and the first reason.
The source list
The Sources page lists imports, newest first. Its summary says how many imports and sources the project has.
- An import for Test (held out) is marked Test data. A Flags column shows how many of its sources are flagged. An upload of several files is named after one of them, such as "faq.pdf and 3 more".
- N examples on a row opens Review on that import's examples. The row's ... menu has Review examples and Delete import….
- The flag chip says how many sources are flagged, such as "3 of 120 sources flagged", or No flags. Choose it to see how many are flagged Possible email address, Possible phone number, Very short (under 20 characters) or Empty. A Long content flag (over 20,000 characters) shows only on the source itself. Flags are hints for review, not a guarantee.
- Search names or locations finds sources by file name or location. Press / to jump to it.
- Choose an import's name to list its sources, with their flags, and Inspect to read one with its provenance.
- Tick imports or single sources, then choose Generate examples. With nothing ticked, it selects every import of documents for training, leaving out imported examples and test data. See Recipes.
Remove an import
On the import's row, open the ⋯ menu and choose Delete import…, then Delete import. This removes its sources and examples, including examples generated from it. Files already on your storage are not erased. You can only remove whole imports, not single sources.
Deleting is refused while a generation, import, quality check or version is being made, when a version was created after the import's examples existed, or when one of its examples is a recipe reference or linked from an experiment's follow-up. To keep such examples out of later versions, reject them in Review.
Tips
- Hold out a real test set. Import a dataset's test split, or a set you wrote yourself, for Test (held out). Your scores are only as good as the test data.
- Add categories. A
categorycolumn lets evaluations break results down by kind of question, and shows gaps in a version's coverage. - Many smaller documents split better than one big one. All examples from one document stay in one split, so ten articles give a version more room than one long PDF. See Groups.
- Approve on import, then look at what's left. Examples with flags wait in Review's Pending tab, so you read the ones that need it.
Limits
| Limit | Value |
|---|---|
| Dataset imports | Unlimited. See How imports count. |
| Files per upload | 20 |
| Size of a file or paste | Shown in the upload dialog: 25 MB |
| PDF, Word and Excel files | 25 MB each; Word and Excel files also 100 MB and 10,000 parts once unpacked |
| PDF pages | 500 |
| Reading a PDF, Word or Excel file | 35 seconds |
| Text extracted from a file | 25 MB |
| Rows per file | 50,000, and at most your organization's rows per import |
| Examples per project | 2,000,000 |
| Columns in a CSV or TSV file | 1,000 |
| Values in a JSON, JSON Lines, YAML or Excel file | 2,000,000: every field name, value and list item counts |
| Excel worksheet | 50,000 rows and 1,000 columns |
| Messages in a conversation | 2 to 100, each up to 100,000 characters |
| Category | 80 characters |
| Column name or path | 200 characters |
| Paste source name | 160 characters |
| Hugging Face rows per import | Your organization's rows per import from the starting row (500,000, at most 5,000,000), the whole split by default; 1 to 5,000 on shared connections |
| Files being sent at once | 4 per organization |
| Hugging Face row, without an image column | 20 MB; larger rows are skipped |
| Rows selected by filters or sampling | 50,000 |
| Rows a filtered import checks | 1 to 50,000, 10,000 by default |
| Filters per import | 8; Equals any of takes 1 to 20 values of up to 200 characters |
| Images | See Vision models |
When something goes wrong
| Message | What to do |
|---|---|
| "Your plan (Plan) allows N rows per import…" | Nothing was imported. Split the file, or set Rows to import lower and import the rest later from a later Start at row. |
| "Your plan (Plan) allows N examples per project…" | The project holds as many examples as your organization's limit allows. Delete examples or imports you don't need, or use another project. A Hugging Face import that stopped this way keeps the rows it added. |
| "Choose between 1 and 20 files at a time" | Upload at most 20 files at once. |
| "Larger than the 25 MB limit of a file", "File exceeds 25 MB", "Office archive exceeds the 100 MB expanded-size or 10,000-entry limit", "PDF imports support at most 500 pages", "Import at most 50,000 rows at a time", "Import at most 2,000,000 values…" or "Document extraction exceeded 35 seconds…" | Split the file into smaller files. |
| "Delimited files have at most 1,000 columns" | Remove the columns you don't import, or save those you do as JSON Lines. |
| "Your organization is already sending 4 files…" | Wait until those uploads finish, then upload again. |
| "The file stopped arriving. Upload it again." or "Imports are busy. Try again in a minute." | Upload the file again; on a slow connection, split it into smaller files. |
| "Document extraction exceeded resource limits or the file is malformed" | Save the file again from its application, or split it. |
| "Supported formats: …" | Save the file in one of the file formats, such as .docx instead of .doc. |
| "Text-based files must use UTF-8 encoding" | Save the file as UTF-8. |
| "No extractable text. Scanned PDFs need OCR before import." | Run OCR on the PDF, or upload its text. |
| "Password-protected PDFs are not supported; upload an unlocked copy" or "Encrypted Office files are not supported" | Upload a copy without a password or encryption. |
| "Invalid JSON on line N", "Line N is not valid JSON." or "Malformed or excessively nested JSON/YAML" | Fix the file, and flatten very deep nesting. In JSON Lines, every line is one complete JSON object. |
| "Delimited files need unique, nonempty column headings" or "Worksheet name: first row needs unique, nonempty text headings" | Give every column a unique heading in the first row. |
| "row N: wrong number of columns" | Fix that line so it has a value for every heading. |
| "Worksheet 'name' was not found" | Fix the name in Excel worksheet (optional), or leave it empty for every worksheet. |
| "Worksheet name, row N: replace formulas/errors with values before import" | Copy the cells and paste them back as values. |
| "No row can be used: no conversation, question and answer, or text column was found. Its columns are …" | Open Column mapping, choose Import as, and name the columns the message lists. See Map columns. |
| "No row can be used: …" with another reason | The mapping doesn't fit the file. Check Import as and the column names. |
| "Decision projects import typed decisions or labelled texts. Choose the decisions mapping mode (state, questions and gold columns) or the labels mode (text and label columns)." | Set Import as to Typed decisions or Labelled texts. See Decision projects. |
| "Typed decisions and labelled texts import into decision projects. Choose text, qa, chat or preference mapping mode." | Import decisions into a decision project. |
| "Choose the labels: a list of 2 to 16 distinct labels.", "Its label is not one of the import's labels" or another problem of a case | See When you import in Decision models. |
| "This row has no question; choose the question and answer columns under Column mapping" (skipped row), or the same for an answer or a conversation | Name the right columns under Column mapping, or leave those rows out. |
| "A message has fields other than role and content" (skipped row) | Remove the extra fields, such as tool calls, from the messages. |
| "The mapped category column holds a NUL character or invalid Unicode" (skipped row) | Fix the row's category text: it holds a character that can't be stored, such as \u0000 in JSON. Or clear Category column (optional). |
| "Some rows already exist in this project for a different purpose…" | Those rows were already imported for training or for evaluation. Leave them out, or delete the import that holds them. |
| "Some rows are already assigned to split…" | Those rows are reserved for another split. Import them with that split, or leave them out. |
| "Nothing new: every row is already in this project" | The rows were imported before. Nothing was added, and the import doesn't count. |
"Paste a https://huggingface.co/datasets/organization/dataset URL or organization/dataset ID" or "Enter a Hugging Face dataset ID such as organization/dataset" |
Paste the dataset page's address, or its ID such as secemp9/arxiv-complete. |
| "Dataset or subset not found…" | Check the address or ID. For a private dataset, add a token that can read it in Connections. |
| "Hugging Face access denied. Accept the dataset's access terms on the Hub with the account of your Hugging Face token…" | Accept the dataset's terms on Hugging Face with your token's account, or, if the token was revoked, reconnect it in Connections. |
| "Hugging Face access denied. Add a Hugging Face token with access to this dataset under Settings → Connections…" | The dataset is gated or private. Add a token that can read it in Connections, and accept the dataset's terms on Hugging Face with that account. |
| "Hugging Face access denied. The dataset is gated or private, and Tensorant's Hugging Face token can't read it…" | Your organization is on shared connections. Import a public dataset, or download the dataset's files and upload them. |
| "Hugging Face is rate limiting requests…" | Wait a minute and try again. |
| "No ready splits…", "Hugging Face has not finished processing this dataset…" or "Hugging Face has no parquet export of this split yet" | Hugging Face hasn't processed it yet. Try again later, or choose another subset or split. |
| "Hugging Face cannot read this subset or split…", "A row group of this dataset is larger than 512 MB; it can't be imported" or "A page of this dataset is larger than 64 MB once decompressed; it can't be imported" | Choose another subset or split, or upload the data as files. |
| "No rows exist at this starting row" | Lower Start at row. |
| "Choose Source documents, Prompt and answer, Chat, or Preference pairs and map its columns before filtering this dataset" | Set Import as and map the columns, then filter. |
| "Character length requires a text column; column is not text" | Use Characters conditions on text columns and Number conditions on numeric ones. |
| "Filtering and sampling need a complete Parquet export…" or "Hugging Face converted only part of this split. Filtering or random sampling cannot cover it reliably…" | Choose a split that Hugging Face converted completely, or import a row range without filters or sampling. |
| "The dataset changed during the import" or "Dataset viewer revision changed…" | The dataset changed on Hugging Face. Choose Load dataset again and start a new import. Rows already imported stay. |
| "Organizations on the platform's connections import at most 5,000 rows at a time…" or "Import exceeds the configured byte limit…" | On shared connections, import fewer rows at a time, then start another import at a later starting row. |
| "Wait for the running generation, import, quality check or freeze to finish" | Wait until Activity shows nothing running, then delete the import. |
| "Version vN was frozen after examples of this import existed…" | The import stays. Reject its examples in Review to leave them out of later versions. |
| "An example of this import is a reference of recipe name" or "…is linked from a follow-up of experiment name" | Remove the example from the recipe's references and save it, or from the follow-up's New examples (Edit, then Save follow-up). Then delete the import. |
Need a hand? Visit troubleshooting