AI Hints
Home›Fine-Tuning LLMs Tutorial›Data: Prompts, Conversations and Sharing
Fine-Tuning LLMs · Lesson 78 of 120

Sharing Datasets

Files and the Hub.

⏱ 2 min read▶ Video at 1:58:53🎓 Free
Watch this lesson in the Fine-Tuning LLMs courseWatch on YouTube ↗Full Fine-Tuning LLMs course

A good dataset takes real work to build. Save it properly, so you can train again later, and share it with your team.

  • Datasets take work
  • Save them properly
  • Share with your team

Three ways to save

There are three common ways. To JSON writes a JSON lines file, readable by anything. Save to disk writes a fast, binary format, that load from disk reads back instantly. And push to hub uploads it to the Hugging Face Hub. Private equals true keeps it visible only to you, or your team.

save.pypython
from chat import data

data["train"].to_json("tickets_chat.jsonl")      # a local file
data.save_to_disk("tickets_chat")                # fast, Arrow format
data.push_to_hub("your-name/riverside-tickets", private=True)   # the Hub

Version your data

Treat datasets like code. Give each version a name, or a date. Write down how it was made, and cleaned. And record which dataset version trained which model. When a model behaves strangely, months later, you'll be glad you did.

keyvalue
Versionname or date every dataset
Documenthow it was made and cleaned
Linkdataset version → model
Lateryou can trace problems

Summary

Let's recap. To JSON for simple files. Save to disk for speed. Push to hub for sharing, kept private if needed. And version every dataset. Next, checking the balance of our labels.

Key takeaways
  • to_json()
  • save_to_disk()
  • push_to_hub(private=True)
Next up: Label Balance — count every class