TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: Never train another ML model again

4 pointsby galgia4 months ago
Hello, Hacker News community!<p>I made FlashLearn, an open-source library designed to streamline the integration of Large Language Models (LLMs) into your workflows. With FlashLearn, you can effortlessly build JSON-based pipelines for tasks like classification and labeling using just a few lines of code, while maintaining standardized outputs for seamless downstream processing.<p><i>Key Features:</i><p>* <i>Quick Setup</i>: Install FlashLearn via PyPI:<p><pre><code> ``` pip install flashlearn ``` Additionally, set your LLM provider credentials if you&#x27;re using OpenAI &#x2F; Deepseek: ``` export OPENAI_API_KEY=&quot;YOUR_API_KEY&quot; ``` </code></pre> * <i>JSON-Centric Pipelines</i>: Easily structure and process data. Here&#x27;s an example of performing sentiment analysis on IMDB movie reviews using a prebuilt skill:<p><pre><code> ```python from flashlearn.utils import imdb_reviews_50k from flashlearn.skills import GeneralSkill from flashlearn.skills.toolkit import ClassifyReviewSentiment # Load data and skills data = imdb_reviews_50k(sample=100) skill = GeneralSkill.load_skill(ClassifyReviewSentiment) tasks = skill.create_tasks(data) # Process tasks in parallel results = skill.run_tasks_in_parallel(tasks) # Save outputs as clean JSON import json with open(&#x27;sentiment_results.jsonl&#x27;, &#x27;w&#x27;) as f: for task_id, output in results.items(): input_json = data[int(task_id)] input_json[&#x27;result&#x27;] = output f.write(json.dumps(input_json) + &#x27;\n&#x27;) ``` </code></pre> * <i>Multi-Step Pipelines</i>: Chain and extend workflows by passing structured outputs to subsequent skills.<p><pre><code> ```python # Example of chaining tasks # next_skill = ... # next_tasks = next_skill.create_tasks([...based on &#x27;output&#x27;...]) # next_results = next_skill.run_tasks_in_parallel(next_tasks) ``` </code></pre> * <i>Custom Skills</i>: For domain-specific needs, easily define custom skills:<p><pre><code> ```python from flashlearn.skills.learn_skill import LearnSkill learner = LearnSkill(model_name=&quot;gpt-4o-mini&quot;) skill = learner.learn_skill(data, task=&#x27;Define categories &quot;satirical&quot;, &quot;quirky&quot;, &quot;absurd&quot;.&#x27;) tasks = skill.create_tasks(data) ``` </code></pre> * <i>Image Classification</i>: Handle visual data with ease using flexible tools for single and multi-label classification.<p><pre><code> ```python from flashlearn.skills.classification import ClassificationSkill images = [...] # Base64-encoded images skill = ClassificationSkill( model_name=&quot;gpt-4o-mini&quot;, categories=[&quot;cat&quot;, &quot;dog&quot;], max_labels=1, system_prompt=&quot;Classify images.&quot; ) tasks = skill.create_tasks(images, column_modalities={&quot;image_base64&quot;: &quot;image_base64&quot;}) results = skill.run_tasks_in_parallel(tasks) ```</code></pre>

no comments

no comments