/ Модель

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

Контекст
4 096 токенов
Параметры
12,9 млрд
Размер весов
26 ГБ
Лицензия
Apache 2.0
Архитектура
llama · dense
Библиотека
transformers
Опубликована
13 авг 2023

docsgpt-14b

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

DocsGPT-14B — дообученная на базе Llama 2 модель для ответов на вопросы по документации с учётом предоставленного контекста.

28скачиваний за 30 дней19лайковвеса обновлены15 авг 2023

Бенчмарки

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

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

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

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

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

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

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

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

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

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

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

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

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

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

DocsGPT-14B — языковая модель семейства Llama, разработанная Arc53 и дообученная с помощью LoRA на базе Llama 2 13B. Модель содержит 12,9 млрд параметров, принимает вопрос и предоставленный контекст документов и генерирует ответ. Для работы используется формат инструкции с отдельными разделами для вопроса, контекста и ответа; длина контекста модели — 4096 токенов.

Модель предназначена для ответов, основанных на документации, и подходит разработчикам и службам технической поддержки: например, её можно подключить к поиску документов и передавать найденные фрагменты в контекст. Карточка сообщает об обучении на 50 тысячах примеров, но оценка качества и бенчмарки ещё находятся в разработке. Поддерживается английский язык. Лицензия Apache-2.0 допускает коммерческое использование.

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

  • ответы на вопросы по технической документации
  • помощь разработчикам по внутренним руководствам
  • ответы службы поддержки на основе базы знаний
  • поиск ответов в документах через RAG

Ограничения

Бенчмарки качества ещё находятся в разработке; ответы зависят от релевантности и полноты переданного контекста. Длина контекста составляет 4096 токенов.

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

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

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

Также подходит для

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

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

Открыть на Hugging Face

This model is fine tuned on top of llama-2-13b

DocsGPT is optimized for Documentation: Specifically fine-tuned for providing answers that are based on documentation provided in context, making it particularly useful for developers and technical support teams.

We used 50k high quality examples to finetune it over 2 days on A10G GPU. We used lora fine tuning process.

Its an apache-2.0 license so you can use it for commercial purposes too.

How to run it

from transformers import AutoTokenizer, AutoModelForCausalLM
import transformers
import torch

model = "Arc53/docsgpt-14b"

tokenizer = AutoTokenizer.from_pretrained(model)
pipeline = transformers.pipeline(
    "text-generation",
    model=model,
    tokenizer=tokenizer,
    torch_dtype=torch.bfloat16,
    trust_remote_code=True,
    device_map="auto",
)
sequences = pipeline(
   "Girafatron is obsessed with giraffes, the most glorious animal on the face of this Earth. Giraftron believes all other animals are irrelevant when compared to the glorious majesty of the giraffe.\nDaniel: Hello, Girafatron!\nGirafatron:",
    max_length=200,
    do_sample=True,
    top_k=10,
    num_return_sequences=1,
    eos_token_id=tokenizer.eos_token_id,
)
for seq in sequences:
    print(f"Result: {seq['generated_text']}")

Benchmarks are still WIP

To prepare your prompts make sure you keep this format:

 ### Instruction
(where the question goes)
### Context
(your document retrieval + system instructions)
### Answer

Here is an example comparing it to meta-llama/Llama-2-14b

Prompt:

### Instruction
Create a mock request to /api/answer in python

### Context
You are a DocsGPT, friendly and helpful AI assistant by Arc53 that provides help with documents. You give thorough answers with code examples if possible.
Use the following pieces of context to help answer the users question. If its not relevant to the question, provide friendly responses.
You have access to chat history, and can use it to help answer the question.
When using code examples, use the following format:
`` ` `` (language)
(code)
`` ` ``

----------------


/api/answer
Its a POST request that sends a JSON in body with 4 values. Here is a JavaScript fetch example
It will recieve an answer for a user provided question

`` ` ``
// answer (POST http://127.0.0.1:5000/api/answer)
fetch("http://127.0.0.1:5000/api/answer", {
      "method": "POST",
      "headers": {
            "Content-Type": "application/json; charset=utf-8"
      },
      "body": JSON.stringify({"question":"Hi","history":null,"api_key":"OPENAI_API_KEY","embeddings_key":"OPENAI_API_KEY",
      "active_docs": "javascript/.project/ES2015/openai_text-embedding-ada-002/"})
})
.then((res) => res.text())
.then(console.log.bind(console))
`` ` ``

In response you will get a json document like this one:

`` ` ``
{
  "answer": " Hi there! How can I help you?\\n",
  "query": "Hi",
  "result": " Hi there! How can I help you?\\nSOURCES:"
}
`` ` ``

 

/api/docs_check
It will make sure documentation is loaded on a server (just run it everytime user is switching between libraries (documentations)
Its a POST request that sends a JSON in body with 1 value. Here is a JavaScript fetch example

`` ` ``
// answer (POST http://127.0.0.1:5000/api/docs_check)
fetch("http://127.0.0.1:5000/api/docs_check", {
      "method": "POST",
      "headers": {
            "Content-Type": "application/json; charset=utf-8"
      },
      "body": JSON.stringify({"docs":"javascript/.project/ES2015/openai_text-embedding-ada-002/"})
})
.then((res) => res.text())
.then(console.log.bind(console))
`` ` ``

In response you will get a json document like this one:
`` ` ``
{
  "status": "exists"
}
`` ` ``




Issues and Pull requests

We value contributions to our issues in form of discussion or suggestion, we recommend that you check out existing issues and our Roadmap

If you want to contribute by writing code there are few things that you should know before doing it:
We have frontend (React, Vite) and Backend (python)


### Answer

docsgpt-14b:

     import requests
     import json

     def send_request(question):
         url = "http://127.0.0.1:5000/api/answer"
         payload = {
             "question": question,
             "history": None,
             "api_key": "YOUR_API_KEY",
             "embeddings_key": "YOUR_EMBEDDINGS_KEY",
             "active_docs": "javascript/.project/ES2015/openai_text-embedding-ada-002/"
         }
         headers = {
             "Content-Type": "application/json; charset=utf-8"
         }

         response = requests.post(url, json=payload, headers=headers)
         if response.status_code == 200:
             answer = response.json()["answer"]
             return answer
         else:
             return "Error: Could not connect to server."

     def check_docs_loaded():
         url = "http://127.0.0.1:5000/api/docs_check"
         payload = {"docs": "javascript/.project/ES2015/openai_text-embedding-ada-002/"}
         headers = {
             "Content-Type": "application/json; charset=utf-8"
         }

         response = requests.post(url, json=payload, headers=headers)
         if response.status_code == 200:
             status = response.json()["status"]
             if status == "exists":
                 return True
             else:
                 return False
         else:
             return False

     def mock_request(question):
         if check_docs_loaded():
             return send_request(question)
         else:
             return "Error: Documentation not loaded."

     # Example usage
     question = "What is the capital of France?"
     answer = mock_request(question)
     print(answer)

This is a mock request to the /api/answer endpoint using Python. It sends a JSON in the body with the question and other required parameters. The response is then parsed and returned.

The original meta-llama/Llama-2-14b:

    
    # answer (POST http://127.0.0.1:5000/api/answer)
    fetch("http://127.0.0.1:5000/api/answer", {
          "method": "POST",
          "headers": {
                "Content-Type": "application/json; charset=utf-8"
          },
          "body": JSON.stringify({"question":"Hi","history":null,"api_key":"OPENAI_API_KEY","embeddings_key":"OPENAI_API_KEY",
          "active_docs": "javascript/.project/ES2015/openai_text-embedding-ada-002/"})
    })
   .then((res) => res.text())
   .then(console.log.bind(console))


### Docs_check

    # answer (POST http://127.0.0.1:5000/api/docs_check)
    fetch("http://127.0.0.1:5000/api/docs_check", {
          "method": "POST",
          "headers": {
                "Content-Type": "application/json; charset=utf-8"
          },
          "body": JSON.stringify({"docs":"javascript/.project/ES2015/openai_text-embedding-ada-002/"})
    })
   .then((res) => res.text())
   .then(console.log.bind(console))


### Installation

    # Install dependencies
    npm install

    # Run the app
    npm run start


### License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details


### Contributing

Contributions are welcome, and they are greatly appreciated! Every little bit helps, and
we are always open to pull requests, and help.


### Acknowledgments

Thanks to the following people for their help and support:

- [@Arc53](https://github.com/Arc53)
- [@Arc53](https://github.com/Arc53)
- [@Arc53](https://github.com/Arc53)
- [@Arc53](https://github.com/Arc53)
- [@Arc53](https://github.com/Arc53)
- [@Arc53](https://github.com/Arc53)
- [@Arc53](https://github.com/Arc53)
- [@Arc53](https://github.com/Arc53)
- [@Arc53](https://github.com/Arc53)
- [@Arc53](https://github.com/Arc53)
- [@Arc53](https://github.com/Arc53)
- [@Arc53](https://github.com/Arc53)
- [@Arc53](https://github.com/Arc53)
- [@Arc53](https://github.com/Arc53)
- [@Arc53](https://github.com/Arc53)
- [@Arc53](https://github.com/Arc53)
- [@Arc53](https://github.com/Arc53)
- [@Arc53](https://github.com/Arc53)
- [@Arc53](https://github.com/Arc53)
- [@Arc53](https://github.com/Arc53)
- [@Arc53](https://github.com/Arc53)
- [@Arc53](https://github.com/Arc53)
- [@Arc53](https://github.com/Arc53)
- [@Arc53](https://github.com/Arc53)
- [@Arc53](https://github.com/Arc53)
- [@Arc53](https://github.com/Arc53)
- [@Arc53](https://github.com/Arc53)
- [@Arc53](https://github.com/Arc53)
- [@Arc53](https://github.com/Arc53)
- [@Arc53](https://github.com/Arc53)
- [@Arc53](https://github.com/Arc53)
- [@Arc53](https://github.com/Arc53)
- [@Arc53](https://github.com/Arc53)
- [@Arc53](https://github.com/Arc53)
- [@Arc53](https://github.com/Arc53)
- [@Arc53](https://github.com/Arc53)
- [@Arc53](https://github.com/Arc53)
- [@Arc53](https

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

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

GPU в ailist

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

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

Подбираем GPU…

Класс архитектуры
LlamaForCausalLM
Ревизия весов
5e70880

0 моделей