/ Модель

Характеристики

Контекст
32 768 токенов
Параметры
7,1 млрд
Лицензия
Apache 2.0
Архитектура
mistral · dense
Библиотека
transformers
Опубликована
27 окт 2023

sql-millennials-7b

Генерация текстаТекст → текст4 профессии

Дообученная Mistral 7B преобразует запросы на английском языке в SQL для работы с базами данных и аналитическими системами.

131скачиваний за 30 дней3лайкавеса обновлены27 окт 2023

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Тесты пользователейпока нет

Никто ещё не опубликовал тест этой модели. Соберите бенчмарк из своих задач — результат появится здесь.

  1. Добавьте модель в бенчмарк

    Вместе с другими моделями категории «Текст» — сравнение идёт внутри одной категории.

  2. Опишите свои задачи

    Напишите запросы, при необходимости приложите файлы и эталонные ответы.

  3. Запустите и опубликуйте

    Модели ответят на каждую задачу, судья оценит ответы. Опубликованный результат появится на этой странице.

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

budecosystem/sql-millennials-7b — модель для преобразования запросов на естественном языке в SQL, созданная дообучением Mistral 7B на наборе из 100 тысяч инструкций по генерации SQL. Она предназначена для интеграции в интерфейсы баз данных, аналитические инструменты, CMS и системы поддержки, чтобы пользователи могли формулировать запросы без знания SQL. Модель построена на плотной архитектуре Mistral, содержит 7,1 млрд параметров и имеет контекст длиной 32 768 токенов. В карточке указана поддержка английского языка; веса доступны в формате PyTorch через Transformers.

Модель генерирует SQL по текстовому запросу и может помочь с аналитическими выборками и поиском записей. Качество запросов зависит от схемы базы данных и контекста, который получает модель; README не приводит оценок качества или подробностей о поддерживаемых диалектах SQL. Лицензия — Apache 2.0.

Сценарии применения

  • генерация SQL-запросов из запросов на естественном языке
  • поиск записей в базе данных через интерфейс на естественном языке
  • подготовка аналитических выборок для специалистов без знания SQL
  • формирование запросов к данным в CMS
  • извлечение сведений из базы для обработки обращений поддержки

Ограничения

Качество SQL зависит от предоставленного контекста и схемы базы данных; в карточке не приведены результаты оценки качества и сведения о поддерживаемых диалектах SQL.

Для каких профессий подходит4

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

Introducing Text-to-SQL Translation Model - Millennials. 🎉

Welcome to our Text-to-SQL Translation Model repository! Our model is specifically fine-tuned for text-to-SQL tasks, aiming to revolutionize how systems understand and translate natural language instructions into SQL queries. Built on Mistral 7B, our model has been meticulously fine-tuned with a curated dataset comprising 100k SQL query generation instructions, ensuring quality and precision.

Features

  • Specialized in converting natural language text to SQL queries.
  • Fine-tuned on a diverse set of 100k SQL query generation instructions.
  • Easy to integrate and use for generating SQL queries on the fly.

Generate responses

Now that your model is fine-tuned, you're ready to generate responses, you can easily generate SQL queries from natural language instructions. To do this, you'll be using our generate.py script, which allows for quick inference and can fetch models directly from the Hugging Face model hub. Here's a quick guide on how to use it:

The script runs inference using the pre-trained model from the Hugging Face model hub and prints the generated SQL query.

import torch
from transformers import AutoTokenizer, AutoModelForCausalLM

tokenizer = AutoTokenizer.from_pretrained("budecosystem/sql-millennials-7b")
model = AutoModelForCausalLM.from_pretrained("budecosystem/sql-millennials-7b")

prompt = "A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions.
USER: Create SQL query for the given table schema and question ASSISTANT:"

inputs = tokenizer(prompt, return_tensors="pt")
sample = model.generate(**inputs, max_length=128)
print(tokenizer.decode(sample[0]))

The script runs inference using the pre-trained model from the Hugging Face model hub and prints the generated SQL query.

Training details

The model is trained of 4 A100 80GB for approximately 30hrs.

HyperparametersValue
per_device_train_batch_size4
gradient_accumulation_steps1
epoch3
steps19206
learning_rate2e-5
lr schedular typecosine
warmup steps2000
optimizeradamw
fp16True
GPU4 A100 80GB

Why millennials?

  1. Automated Database Management for Businesses

Scenario: Small to medium-sized enterprises (SMEs) often lack dedicated IT teams to handle database queries, making it challenging to retrieve specific data quickly for analysis and decision-making.

Use Case: Your text-to-SQL model can be integrated into a company's internal systems, allowing staff without technical SQL knowledge to retrieve data. They can input natural language requests, such as "Get a list of all transactions above $10,000 in the last quarter," and the system, powered by your model, would convert this into a corresponding SQL query to retrieve the data.

  1. Automating Data Analytics Processes Scenario: Data analysts and business professionals often face bottlenecks in generating insights due to the complexities of SQL query formulation, especially when immediate or repetitive data retrieval and analysis are required.

Use Case: Your text-to-SQL model serves as a transformative intermediary in this scenario. By integrating the model into their data analytics systems, organizations enable professionals to input data requests in natural language. For instance, an analyst could input, "Show the trend of online sales growth over the past five years," and the system would instantly convert this request into a SQL query, retrieve the data, and even integrate it into visualization tools for immediate insight generation. This functionality not only accelerates the analytical processes but also democratizes data-driven insights across different organizational departments, allowing even non-technical staff to leverage the power of real-time data analytics without deep knowledge of SQL.

  1. Enhancing CMS Interfaces Scenario: Content Management Systems (CMS) are often non-intuitive for non-technical content managers when it comes to complex data retrieval or database management.

Use Case: CMS providers can leverage your model to enhance their system's backend interface. Content managers can use natural language to request specific data, like "Find all blog posts in May 2023 with more than 500 views," and the model will generate the appropriate SQL to retrieve the information. This feature makes database management more accessible, efficient, and user-friendly.

  1. Customer Support Optimization Scenario: Customer support centers often need to retrieve client or product information stored in databases while resolving tickets or inquiries, requiring basic knowledge of SQL.

Use Case: Your model can be integrated into support ticketing systems, enabling support personnel to type requests in natural language, such as "Show all open tickets from customers in New York filed this month," and immediately receive the data needed to expedite their resolution process, improving customer service efficiency and response time.

  1. Data Journalism and Research Scenario: Journalists and researchers frequently rely on complex databases to gather insights and data points necessary for their work but may lack the technical know-how of SQL.

Use Case: By integrating your text-to-SQL model into research software or journalistic tools, professionals can query databases using natural language. For example, a journalist might input, "Retrieve the average household income in Texas in 2022," and your model would facilitate immediate access to this data, allowing for more efficient research and data-driven storytelling.

Contributing We welcome contributions to help improve the model or address issues. Please feel free to submit pull requests or open issues to discuss changes or improvements.

Acknowledgments

We'd like to thank the open-source community and the researchers whose foundational work laid the path to this model.

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · transformers

Можно запустить

Подбираем GPU…

Класс архитектуры
MistralForCausalLM
Ревизия весов
4ee9c71

0 моделей