Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add python samples #21

Commits on Jun 5, 2024

  1. Configuration menu
    Copy the full SHA
    e1502d6 View commit details
    Browse the repository at this point in the history
  2. indentation

    Wovchena committed Jun 5, 2024
    Configuration menu
    Copy the full SHA
    f45221f View commit details
    Browse the repository at this point in the history
  3. compare cpp and py

    Wovchena committed Jun 5, 2024
    Configuration menu
    Copy the full SHA
    767db1f View commit details
    Browse the repository at this point in the history
  4. -

    Wovchena committed Jun 5, 2024
    Configuration menu
    Copy the full SHA
    caa7438 View commit details
    Browse the repository at this point in the history
  5. source

    Wovchena committed Jun 5, 2024
    Configuration menu
    Copy the full SHA
    aed5b37 View commit details
    Browse the repository at this point in the history
  6. indent

    Wovchena committed Jun 5, 2024
    Configuration menu
    Copy the full SHA
    7e4abad View commit details
    Browse the repository at this point in the history
  7. shell: cmd

    Wovchena committed Jun 5, 2024
    Configuration menu
    Copy the full SHA
    e190226 View commit details
    Browse the repository at this point in the history
  8. remove indentation

    Wovchena committed Jun 5, 2024
    Configuration menu
    Copy the full SHA
    13977be View commit details
    Browse the repository at this point in the history
  9. indentation

    Wovchena committed Jun 5, 2024
    Configuration menu
    Copy the full SHA
    14deab1 View commit details
    Browse the repository at this point in the history
  10. chmod

    Wovchena committed Jun 5, 2024
    Configuration menu
    Copy the full SHA
    c694770 View commit details
    Browse the repository at this point in the history
  11. PYTHONPATH

    Wovchena committed Jun 5, 2024
    Configuration menu
    Copy the full SHA
    63956a5 View commit details
    Browse the repository at this point in the history
  12. indentation

    Wovchena committed Jun 5, 2024
    Configuration menu
    Copy the full SHA
    782642e View commit details
    Browse the repository at this point in the history
  13. sh

    Wovchena committed Jun 5, 2024
    Configuration menu
    Copy the full SHA
    5eec344 View commit details
    Browse the repository at this point in the history
  14. flush

    Wovchena committed Jun 5, 2024
    Configuration menu
    Copy the full SHA
    0d40c5a View commit details
    Browse the repository at this point in the history
  15. verbose

    Wovchena committed Jun 5, 2024
    Configuration menu
    Copy the full SHA
    ff28df5 View commit details
    Browse the repository at this point in the history

Commits on Jun 6, 2024

  1. Configuration menu
    Copy the full SHA
    1b57c47 View commit details
    Browse the repository at this point in the history
  2. Debug

    Wovchena committed Jun 6, 2024
    Configuration menu
    Copy the full SHA
    6da2340 View commit details
    Browse the repository at this point in the history
  3. align samples

    Wovchena committed Jun 6, 2024
    Configuration menu
    Copy the full SHA
    5abb994 View commit details
    Browse the repository at this point in the history
  4. cmod

    Wovchena committed Jun 6, 2024
    Configuration menu
    Copy the full SHA
    b6a0808 View commit details
    Browse the repository at this point in the history
  5. correct compilation

    Wovchena committed Jun 6, 2024
    Configuration menu
    Copy the full SHA
    24819d2 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    6c893fe View commit details
    Browse the repository at this point in the history
  7. pythonpath

    Wovchena committed Jun 6, 2024
    Configuration menu
    Copy the full SHA
    5839264 View commit details
    Browse the repository at this point in the history
  8. correct install path

    Wovchena committed Jun 6, 2024
    Configuration menu
    Copy the full SHA
    7da29c6 View commit details
    Browse the repository at this point in the history
  9. set_target_properties

    Wovchena committed Jun 6, 2024
    Configuration menu
    Copy the full SHA
    557baa9 View commit details
    Browse the repository at this point in the history
  10. USE_SOURCE_PERMISSIONS

    Wovchena committed Jun 6, 2024
    Configuration menu
    Copy the full SHA
    f0bdeff View commit details
    Browse the repository at this point in the history
  11. .texts

    Wovchena committed Jun 6, 2024
    Configuration menu
    Copy the full SHA
    a308424 View commit details
    Browse the repository at this point in the history
  12. dont compare Qwen-7B-Chat

    Wovchena committed Jun 6, 2024
    Configuration menu
    Copy the full SHA
    8027e15 View commit details
    Browse the repository at this point in the history
  13. &&

    Wovchena committed Jun 6, 2024
    Configuration menu
    Copy the full SHA
    6c64941 View commit details
    Browse the repository at this point in the history
  14. correct assert

    Wovchena committed Jun 6, 2024
    Configuration menu
    Copy the full SHA
    59bd1fa View commit details
    Browse the repository at this point in the history
  15. correct zip

    Wovchena committed Jun 6, 2024
    Configuration menu
    Copy the full SHA
    a71e60a View commit details
    Browse the repository at this point in the history
  16. sort texts

    Wovchena committed Jun 6, 2024
    Configuration menu
    Copy the full SHA
    b6ed8d4 View commit details
    Browse the repository at this point in the history
  17. __str__

    Wovchena committed Jun 6, 2024
    Configuration menu
    Copy the full SHA
    d1910ef View commit details
    Browse the repository at this point in the history
  18. correct tests

    Wovchena committed Jun 6, 2024
    Configuration menu
    Copy the full SHA
    16eca6d View commit details
    Browse the repository at this point in the history
  19. greedy

    Wovchena committed Jun 6, 2024
    Configuration menu
    Copy the full SHA
    338038a View commit details
    Browse the repository at this point in the history
  20. correct comparison

    Wovchena committed Jun 6, 2024
    Configuration menu
    Copy the full SHA
    34342fe View commit details
    Browse the repository at this point in the history
  21. Configuration menu
    Copy the full SHA
    833a301 View commit details
    Browse the repository at this point in the history

Commits on Jun 7, 2024

  1. Configuration menu
    Copy the full SHA
    d273912 View commit details
    Browse the repository at this point in the history
  2. max_new_tokens

    Wovchena committed Jun 7, 2024
    Configuration menu
    Copy the full SHA
    fbb6d86 View commit details
    Browse the repository at this point in the history
  3. print

    Wovchena committed Jun 7, 2024
    Configuration menu
    Copy the full SHA
    065d15b View commit details
    Browse the repository at this point in the history
  4. compilation

    Wovchena committed Jun 7, 2024
    Configuration menu
    Copy the full SHA
    e659fb8 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    476f67f View commit details
    Browse the repository at this point in the history
  6. print

    Wovchena committed Jun 7, 2024
    Configuration menu
    Copy the full SHA
    7fc6b59 View commit details
    Browse the repository at this point in the history
  7. set_property

    Wovchena committed Jun 7, 2024
    Configuration menu
    Copy the full SHA
    8e53f42 View commit details
    Browse the repository at this point in the history
  8. and

    Wovchena committed Jun 7, 2024
    Configuration menu
    Copy the full SHA
    deb543f View commit details
    Browse the repository at this point in the history
  9. and

    Wovchena committed Jun 7, 2024
    Configuration menu
    Copy the full SHA
    aa21014 View commit details
    Browse the repository at this point in the history
  10. TinyLlama-1.1B-Chat-v1.0

    Wovchena committed Jun 7, 2024
    Configuration menu
    Copy the full SHA
    8c4b7a1 View commit details
    Browse the repository at this point in the history
  11. rc2

    Wovchena committed Jun 7, 2024
    Configuration menu
    Copy the full SHA
    66dc3cb View commit details
    Browse the repository at this point in the history
  12. path

    Wovchena committed Jun 7, 2024
    Configuration menu
    Copy the full SHA
    5c4fc77 View commit details
    Browse the repository at this point in the history
  13. remove preint

    Wovchena committed Jun 7, 2024
    Configuration menu
    Copy the full SHA
    3f7e9de View commit details
    Browse the repository at this point in the history
  14. correct

    Wovchena committed Jun 7, 2024
    Configuration menu
    Copy the full SHA
    61dec7c View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    a8726e0 View commit details
    Browse the repository at this point in the history
  16. revert

    Wovchena committed Jun 7, 2024
    Configuration menu
    Copy the full SHA
    dd6d19a View commit details
    Browse the repository at this point in the history
  17. more

    Wovchena committed Jun 7, 2024
    Configuration menu
    Copy the full SHA
    ed65cfb View commit details
    Browse the repository at this point in the history
  18. print

    Wovchena committed Jun 7, 2024
    Configuration menu
    Copy the full SHA
    cbec967 View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    e01295f View commit details
    Browse the repository at this point in the history
  20. and

    Wovchena committed Jun 7, 2024
    Configuration menu
    Copy the full SHA
    6977510 View commit details
    Browse the repository at this point in the history
  21. reorder

    Wovchena committed Jun 7, 2024
    Configuration menu
    Copy the full SHA
    1e8a17e View commit details
    Browse the repository at this point in the history
  22. smaller

    Wovchena committed Jun 7, 2024
    Configuration menu
    Copy the full SHA
    bba9b89 View commit details
    Browse the repository at this point in the history
  23. simplify

    Wovchena committed Jun 7, 2024
    Configuration menu
    Copy the full SHA
    8ec3e07 View commit details
    Browse the repository at this point in the history
  24. remove sx

    Wovchena committed Jun 7, 2024
    Configuration menu
    Copy the full SHA
    38fbe6b View commit details
    Browse the repository at this point in the history
  25. 2

    Wovchena committed Jun 7, 2024
    Configuration menu
    Copy the full SHA
    9c3eac1 View commit details
    Browse the repository at this point in the history
  26. retrigger

    Wovchena committed Jun 7, 2024
    Configuration menu
    Copy the full SHA
    ae3555e View commit details
    Browse the repository at this point in the history
  27. openvino.serialize

    Wovchena committed Jun 7, 2024
    Configuration menu
    Copy the full SHA
    4faba69 View commit details
    Browse the repository at this point in the history
  28. 1

    Wovchena committed Jun 7, 2024
    Configuration menu
    Copy the full SHA
    5f55850 View commit details
    Browse the repository at this point in the history

Commits on Jun 10, 2024

  1. Generate pipeline (openvinotoolkit#334)

    LLM return logits with probabilities of each token, these probabilities
    can be converted to tokens/words with different technics: greedy
    decoding, beam search decoding, random sampling, etc.
    
    This requires writing user unfriendly post-processing even for the
    simplest scenario of greedy decoding. In order to make live easier we we
    combined all decoding scenarios into a single function call, where the
    decoding method and parameters are specified by arguments.
    
    In this PR we provide a user friendly API for text generation inspired
    by `generate` method from HuggingFace transformers library.
    
    - [x] enable calling tokenizers/detokenizers from LLMPipeline
    - [ ] add callback for streaming mode - done partially, need to improve
    - [x] rewritten samples with the current approach:
    [causal_lm/cpp/generate_pipeline/generate_sample.cpp#L73-L83](https://github.com/pavel-esir/openvino.genai/blob/generate_pipeline/text_generation/causal_lm/cpp/generate_pipeline/generate_sample.cpp#L73-L83)
    - [x] Multibatch greedy decoding
    - [ ] Speculative decoding
    - [ ] Grouped Beam Search decoding: ready for batch 1, need to rebase
    multibatch support after merging
    openvinotoolkit#349
    - [x] Random sampling
    
    Example 1: Greedy search generation
    ```
    LLMPipeline pipe(model_path, device);
    
    // Will try to load config from generation_config.json.
    // but if not found default velues for gready search will be used
    GenerationConfig config = pipe.generation_config();
    
    cout << pipe(prompt, config.max_new_tokens(20));
    ```
    
    Example 2: TextStreaming mode
    ```
    LLMPipeline pipe(model_path, device);
    
    GenerationConfig config = pipe.generation_config();
    
    auto text_streamer = TextStreamer{pipe};
    auto text_streamer_callback = [&text_streamer](std::vector<int64_t>&& tokens, LLMPipeline& pipe){
        text_streamer.put(tokens[0]);
    };
    
    pipe(prompt, config.max_new_tokens(20).set_callback(text_streamer_callback));
    text_streamer.end();
    ```
    
    CVS-132907 CVS-137920
    
    ---------
    
    Co-authored-by: Wovchena <vladimir.zlobin@intel.com>
    Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com>
    Co-authored-by: Alexander Suvorov <alexander.suvorov@intel.com>
    Co-authored-by: Yaroslav Tarkan <yaroslav.tarkan@intel.com>
    Co-authored-by: Xiake Sun <xiake.sun@intel.com>
    Co-authored-by: wenyi5608 <93560477+wenyi5608@users.noreply.github.com>
    Co-authored-by: Ekaterina Aidova <ekaterina.aidova@intel.com>
    Co-authored-by: guozhong wang <guozhong.wang@intel.com>
    Co-authored-by: Chen Peter <peter.chen@intel.com>
    10 people committed Jun 10, 2024
    Configuration menu
    Copy the full SHA
    fe265ec View commit details
    Browse the repository at this point in the history
  2. remove optimum-intel

    Wovchena authored and ilya-lavrenov committed Jun 10, 2024
    Configuration menu
    Copy the full SHA
    26c3c40 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    0abcb61 View commit details
    Browse the repository at this point in the history
  4. correct

    Wovchena committed Jun 10, 2024
    Configuration menu
    Copy the full SHA
    8ecb3bd View commit details
    Browse the repository at this point in the history
  5. revert

    Wovchena committed Jun 10, 2024
    Configuration menu
    Copy the full SHA
    04dd619 View commit details
    Browse the repository at this point in the history
  6. align

    Wovchena committed Jun 10, 2024
    Configuration menu
    Copy the full SHA
    29e4258 View commit details
    Browse the repository at this point in the history