Spaces:
Sleeping
Sleeping
| title: thoshan_Flash | |
| emoji: π¨ | |
| colorFrom: yellow | |
| colorTo: purple | |
| sdk: gradio | |
| sdk_version: 5.45.0 | |
| app_file: app.py | |
| pinned: true | |
| license: mit | |
| # π thoshan_Flash - Complete Offline Package | |
| A conversational Large language model with a fun, flirty personality. This repository includes everything you need for offline development and training - no cloud dependencies required! | |
| ## π What's Included | |
| - **Ready-to-run Gradio app** (`app.py`) - No modifications needed | |
| - **Flirty tech dataset** (`flirt_dataset.jsonl`) - 20 Q&A pairs for training | |
| - **Complete offline setup** - All dependencies clearly listed | |
| - **Zero cloud dependencies** - Works entirely on your local machine | |
| - **Copy-paste ready** - All commands tested and ready to use | |
| ## π¦ Download & Quick Start | |
| ### Option 1: Clone Everything | |
| ```bash | |
| # Clone the complete repository | |
| git clone https://huggingface.co/spaces/lingadevaruhp/thoshan_Flash_mini | |
| cd thoshan_Flash_mini | |
| # Install dependencies (one command, no conflicts) | |
| pip install transformers torch gradio accelerate | |
| # Run immediately | |
| python app.py | |
| ``` | |
| ### Option 2: Download Just the Dataset | |
| Get the dataset file directly for your own projects: | |
| - **Raw JSONL**: [flirt_dataset.jsonl](https://huggingface.co/spaces/lingadevaruhp/thoshan_Flash_mini/raw/main/flirt_dataset.jsonl) | |
| - **Direct download**: Right-click β "Save as" or use `wget` | |
| ```bash | |
| # Download dataset only | |
| wget https://huggingface.co/spaces/lingadevaruhp/thoshan_Flash_mini/raw/main/flirt_dataset.jsonl | |
| ``` | |
| ## π₯ Using the Dataset (Offline Training) | |
| The `flirt_dataset.jsonl` file contains 20 flirty tech Q&A pairs in standard format: | |
| ```json | |
| {"instruction": "Hey gorgeous, explain machine learning to me", "response": "Aww, you're so cute when you're curious! π Think of machine learning like..."} | |
| ``` | |
| ### Load in Python (Copy-Paste Ready) | |
| ```python | |
| import json | |
| # Load the dataset | |
| with open('flirt_dataset.jsonl', 'r') as f: | |
| dataset = [json.loads(line) for line in f] | |
| print(f"Loaded {len(dataset)} flirty tech examples!") | |
| for item in dataset[:2]: # Show first 2 | |
| print(f"Q: {item['instruction']}") | |
| print(f"A: {item['response'][:100]}...\n") | |
| ``` | |
| ### Use with Popular Training Libraries | |
| ```python | |
| # With Hugging Face datasets | |
| from datasets import load_dataset | |
| dataset = load_dataset('json', data_files='flirt_dataset.jsonl') | |
| # With pandas | |
| import pandas as pd | |
| df = pd.read_json('flirt_dataset.jsonl', lines=True) | |
| # Direct training format | |
| training_data = [] | |
| with open('flirt_dataset.jsonl', 'r') as f: | |
| for line in f: | |
| data = json.loads(line) | |
| training_data.append({ | |
| 'input': data['instruction'], | |
| 'output': data['response'] | |
| }) | |
| ``` | |
| ## π» Model Information | |
| - **Base Model**: `thoshan_Flash` | |
| - **No fine-tuning required** - Works out of the box | |
| - **Public model** - No API keys or special access needed | |
| - **Lightweight** - Runs on consumer GPUs (4GB+ VRAM recommended) | |
| - **Fast inference** - Optimized for real-time chat | |
| ## π Advanced Usage | |
| ### Custom Training with Your Data | |
| ```python | |
| # Combine with your own data | |
| my_data = [] | |
| with open('flirt_dataset.jsonl', 'r') as f: | |
| my_data.extend([json.loads(line) for line in f]) | |
| # Add your own examples | |
| my_data.append({ | |
| "instruction": "Your custom question", | |
| "response": "Your custom flirty response" | |
| }) | |
| # Save combined dataset | |
| with open('my_custom_dataset.jsonl', 'w') as f: | |
| for item in my_data: | |
| f.write(json.dumps(item) + '\n') | |
| ``` | |
| ### Fine-tune Locally (Optional) | |
| ```python | |
| # Example fine-tuning setup (requires additional setup) | |
| from transformers import AutoTokenizer, AutoModelForCausalLM | |
| from transformers import TrainingArguments, Trainer | |
| model_name = "thoshan_Flash" | |
| tokenizer = AutoTokenizer.from_pretrained(model_name) | |
| model = AutoModelForCausalLM.from_pretrained(model_name) | |
| # Your fine-tuning code here... | |
| ``` | |
| ## π οΈ Troubleshooting | |
| ### Common Issues & Solutions | |
| **"Model not found"** β Check internet connection for first download | |
| ```bash | |
| pip install --upgrade transformers torch | |
| ``` | |
| **"Out of memory"** β Reduce batch size or use CPU mode | |
| ```python | |
| # In app.py, add: | |
| device = "cpu" # Force CPU usage | |
| ``` | |
| **"Gradio won't start"** β Update Gradio | |
| ```bash | |
| pip install --upgrade gradio | |
| ``` | |
| **"Dataset won't load"** β Verify file format | |
| ```bash | |
| # Check if file is valid JSON lines | |
| python -c "import json; [json.loads(line) for line in open('flirt_dataset.jsonl')]; print('Valid!')" | |
| ``` | |
| ## π Dataset Details | |
| **Content**: 20 technology-themed Q&A pairs with flirty, fun responses | |
| **Topics covered**: Machine learning, web development, databases, DevOps, security, and more | |
| **Format**: Standard JSONL (one JSON object per line) | |
| **Size**: ~10.4KB - Perfect for quick experiments | |
| **Style**: Educational but playful - explains complex tech concepts with personality | |
| ## π― Perfect For | |
| - **Learning AI development** - Complete, working example | |
| - **Chatbot experimentation** - Ready-made personality dataset | |
| - **Offline development** - No API dependencies | |
| - **Educational projects** - Fun way to learn tech concepts | |
| - **Fine-tuning practice** - Small, manageable dataset | |
| ## π Updates & Versions | |
| - **Latest**: Added complete offline dataset (flirt_dataset.jsonl) | |
| - **Improved**: Zero-dependency local setup | |
| - **Fixed**: All dependency conflicts resolved | |
| - **Added**: Copy-paste ready code examples | |
| --- | |
| **Ready to get flirty with AI? Download, run, and start chatting! π** |