text:
Add support for parsing JSON on item definition?

Sometime we do a lot of web scraping that gets content from API JSON response instead of parsing HTML dom.
Let's say a JSON response look likes this
{
  "code": 200,
  "data": {
    "typeId": 17,
    "process": 0,
    "novelSell": 0,
    "wordType": 0,
    "list": [
      {
        "novel_id": 116409,
        "novel_status": 1,
        "novel_lock": 0,
        "author_id": 31392,
        "novel_name": "问棺",
        "novel_cover": "https://resourcecp.oss-cn-beijing.aliyuncs.com/uploads/20190731/1152167ce977cdda335c4360d45ccf7bf71cd557.jpg?x-oss-process=style/small",
        "novel_desc": "叩棺门，问三声。",
        "novel_author": "七小皇叔",
        "novel_wordnumber": 362514,
        "novel_uptime": "04-02",
        "novel_type": "幻想",
        "novel_tag": "脑洞",
        "novel_allclick": 0,
        "novel_process": 1,
        "novel_allcoll": 0,
        "novel_clock": 0,
        "novel_sell": 0,
        "relieve_vip": 0,
        "plagiarism": 0,
        "order_val": 36771
      },
      {
        "novel_id": 118934,
        "novel_status": 1,
        "novel_lock": 0,
        "author_id": 33683,
        "novel_name": "女捕",
        "novel_cover": "https://resourcecp.oss-cn-beijing.aliyuncs.com/uploads/20190820/d0350796ef62d875c5c542296342197b.jpeg?x-oss-process=style/small",
        "novel_desc": "身穿捕服，剑走江湖。",
        "novel_author": "藏匿于人",
        "novel_wordnumber": 1698883,
        "novel_uptime": "05-26",
        "novel_type": "百合",
        "novel_tag": "武侠",
        "novel_allclick": 0,
        "novel_process": 1,
        "novel_allcoll": 0,
        "novel_clock": 0,
        "novel_sell": 0,
        "relieve_vip": 0,
        "plagiarism": 0,
        "order_val": 29323
      }
 ]
}

Define item class in this way
class BookItem(Item):
    target_item = JSONListField(json_select'data.list')
    id = JSONTextField(json_select='novel_id')
    status = JSONTextField(json_select='novel_status')
   title = JSONTextField(json_select='novel_name')

@howie6879

This depends on a JSON parsing library like lxml, do you have any suggestions in this regard?


text:
Cost of swapping

How should the cost/reward of swapping component should be implemented?

The idea of swapping components was abandoned due to the cost of possible permutations and action space changes. Component-Failure-Pairs now can be directly repaired without being on top of a stack.

source: gharchive/issue

license: MIT

license_type: permissive

license_source: github-api


text:
Add Bookmarks

As a user I want to create bookmarks in order to save often visit websites
predicted: 8

Acceptance Criteria:

[ ] No errors should be thrown when trying to add a bookmark
[ ] Bookmark should be saved

repo: hpi-swa-teaching/Scamper


text:
Add scrollable openChatsList

Is your feature request related to a problem? Please describe.
The chatslist currently only shows as many chats as fit in the Main Window. But User should be able to scroll down and see all open chats. They are currently hidden because morph overflow is hidden.
Describe the solution you'd like
Build a Scrollable List. Maybe the Legacy Project hast this implemented?

Needs to have properly ordered list of chats first

authors: rohansaw schmidtjonas

repo: hpi-swa-teaching/TelegramClient


text:
US_4.16: Application confirmation 💰 5

As
pupil
I want to
get a confirmation email when I submitted my application
in order to
be sure, that it was submitted successfully.
dependency: #40, ...
acceptance criteria:

a mail is sent to the mail address which is registered to the user
the mail says that the application was submitted, and for what the user applied:
"Liebe[r] [Vorname] [Nachname],
du hast dich erfolgreich für die Veranstaltung [Veranstaltungsname] beworben. Deine Bewerbung wird von uns bearbeitet. Für den aktuellen Status deiner Bewerbung siehe unter "Meine Bewerbungen" im Portal" (Portal with Link to the start page).
Viele Grüße
das HPI-Workshop-Team
mit den entsprechenden Zeilenumbrüchen!
representative mail address

Now, it is for me:
"Liebe Lisa Ihde,\n\r du hast dich erfolgreich für die Veranstaltung Einführung in die Kunst der Gongakrobatik beworben. Deine Bewerbung wird von uns bearbeitet. Für den aktuellen Status deiner Bewerbung siehe unter "Meine Veranstaltungen" im Portal (http://workshop-portal-dev.herokuapp.com/applications)."
\n\r is wrong
and "Viele Grüße, das HPI Workshop Team" is missed
additionally "Portal" should be the link and not the url in "(...)"

Zeilenumbruchanstelle des Kommas nach "Viele Grüße" fehlt noch.
Bei mir wird nach "Status deiner Bewerbung" ein Zeilenumbruch gemacht (könnte auch an meinem Email-Tool liegen).
Optional Veranstaltungsnamen kursiv oder in Anführungsstrichen setzen.

Push es auf den dev, dann kann ich es testen

license: mit

license_source: bigquery


text:
Plan to merge to upstream?

Many thanks for the great work! I'm wondering if you have any plan to merge your codes to upstream dmlc/mxnet?

Hi Mu,
We are happy to do that if this implementation becomes more stable. Of course we may then need your help to do this in a more appropriate way.
HJ

Hi Hangjao, I'll be in Berlin in a week. Do you want to catch up? Alex.

Hi Alex,
we are very exited to meet you in Berlin, or even honored to invite you to HPI if possible. We could further talk about it using email haojin.yang@hpi.de .
Best
HJ

Closing this, since we only support the new version from now on: https://github.com/hpi-xnor/BMXNet-v2

authors: Jopyth mli smolix yanghaojin

repo: hpi-xnor/BMXNet


text:
[SOLVED] the custom keybinds are not working (NeoVIm, with Lazy.nvim plugin manager).

FAQ

[X] I have checked the FAQ and it didn't resolve my problem.

Announcement

[X] I have checked Breaking change announcement.

Minimal reproducible full config
if has('vim_starting')
  set encoding=utf-8
endif
scriptencoding utf-8

if &compatible
  set nocompatible
endif

let s:plug_dir = expand('/tmp/plugged/vim-plug')
if !filereadable(s:plug_dir .. '/plug.vim')
  execute printf('!curl -fLo %s/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim', s:plug_dir)
end

execute 'set runtimepath+=' . s:plug_dir
call plug#begin(s:plug_dir)
Plug 'hrsh7th/nvim-cmp'
Plug 'hrsh7th/cmp-buffer'
Plug 'hrsh7th/cmp-nvim-lsp'
Plug 'hrsh7th/vim-vsnip'
Plug 'neovim/nvim-lspconfig'
Plug 'hrsh7th/cmp-path',
Plug 'L3MON4D3/LuaSnip',
Plug 'saadparwaiz1/cmp_luasnip',
Plug 'rafamadriz/friendly-snippets',
Plug 'onsails/lspkind.nvim'
call plug#end()
PlugInstall | quit

" Setup global configuration. More on configuration below.
lua << EOF
local cmp = require("cmp")
        local luasnipc = require("luasnip")
        local lspkindc = require("lspkind")

        require("luasnip.loaders.from_vscode").lazy_load()
        cmp.setup({
            completion = {
                completeopt = "menu,menuone,preview,noselect",
            },
            snippet = {
                expand = function(args)
                    luasnipc.lsp_expand(args.body)
                end,
            },
            mappings = cmp.mapping.preset.insert({
                ['<Down>'] = function(fallback)
                    if cmp.visible() then
                        cmp.select_next_item()
                    else
                        fallback()
                    end
                end,
                ['<Up>'] = function(fallback)
                    if cmp.visible() then
                        cmp.select_prev_item()
                    else
                        fallback()
                    end
                end,
                ["<CR>"] = cmp.mapping.confirm({
                    behavior = cmp.ConfirmBehavior.Insert,
                    select = true
                }),
                ["<C-Up>"] = cmp.mapping(cmp.mapping.scroll_docs(-4), { "i", "c" }),
                ["<C-Down>"] = cmp.mapping(cmp.mapping.scroll_docs(4), { "i", "c" }),
                ["<C-Space>"] = cmp.mapping(cmp.mapping.complete(), { "i", "c" }),
                ["<Esc>"] = cmp.mapping {
                    i = cmp.mapping.abort(),
                    c = cmp.mapping.close(),
                },
                ["<C-l>"] = cmp.mapping(function()
                    if luasnip.expand_or_locally_jumpable then
                        luasnip.expand_or_jump()
                    end
                end, { "i", "s" }),
                ["<C-h>"] = cmp.mapping(function()
                    if luasnip.locally_jumpable(-1) then
                        luasnip.jump(-1)
                    end
                end, { "i", "s" }),
            }),

            sources = cmp.config.sources({
                { name = "nvim_lsp" },
                { name = "luasnip" },
                { name = "buffer" },
                { name = "path" },
            }),

            formatting = {
                format = lspkindc.cmp_format({
                    maxwidth = 50,
                    ellipsis_char = "...",
                }),
            },
        })
EOF

lua << EOF
local capabilities = require('cmp_nvim_lsp').default_capabilities()

require'lspconfig'.cssls.setup {
  capabilities = capabilities,
}
EOF

Description
https://github.com/user-attachments/assets/72de1f2b-ef07-4a30-b8f6-129445b7d6d9
This video show what is happening.
I've used the Minimal reproducible full config too, and it doesn't work as well, both the default keys and my custom defined keys don't work, but the menu shows up.
I don't how to fix this bc I've came back to neovim after a while and everything I knew about nvim-cmp doesn't seem to be working.
I just want to use the <Up>/<Down> keys to select the entry and use <Tab>/<CR>(Enter) to select it.
this is the output of nvim -V1 -v:
NVIM v0.11.0-dev-941+gcd8e15e337
Build type: Release
LuaJIT 2.1.1725453128

How could I fix this?
Steps to reproduce
just use this minimal lazy.nvim lua config, open a C source file and try to auto-complete something:
vim.g.mapleader = " "
vim.g.maplocalleader = "\\"

-- Bootstrap lazy.nvim
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
  local lazyrepo = "https://github.com/folke/lazy.nvim.git"
  local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
  if vim.v.shell_error ~= 0 then
    vim.api.nvim_echo({
      { "Failed to clone lazy.nvim:\n", "ErrorMsg" },
      { out, "WarningMsg" },
      { "\nPress any key to exit..." },
    }, true, {})
    vim.fn.getchar()
    os.exit(1)
  end
end
vim.opt.rtp:prepend(lazypath)

-- Setup lazy.nvim
require("lazy").setup({
  spec = {
    {
        "nvim-treesitter/nvim-treesitter",
        build = ":TSUpdate",
        config = function ()
          local configs = require("nvim-treesitter.configs")

          configs.setup({
              ensure_installed = { "c", "lua", "vim", "vimdoc" },
              sync_install = true,
              highlight = { enable = true },
              indent = { enable = true },
            })
        end
    },
    {
        "williamboman/mason.nvim",
        opts = {
            ui = {
                icons = {
                    package_installed = "✓",
                    package_pending = "➜",
                    package_uninstalled = "✗"
                }
            },
            ensure_installed = {
                "clangd",
                "clang-tidy",
            },
        },
    },
    {"williamboman/mason-lspconfig.nvim"},
    {
        "neovim/nvim-lspconfig",
        dependencies = {
            "williamboman/mason.nvim",
            "williamboman/mason-lspconfig.nvim"
        },
        config = function()
            require("mason").setup()
            require("mason-lspconfig").setup()
            -- I've opted for a manual configuration here to have more control
            -- of the lsps settings.
            require("lspconfig").clangd.setup({
                cmd = {
                    "clangd",
                    "--background-index",
                    "-j=8",
                    "--query-driver=/usr/bin/**/clang-*,/bin/clang,/bin/clang++,/usr/bin/gcc,/usr/bin/g++",
                    "--clang-tidy",
                    "--clang-tidy-checks=*",
                    "--all-scopes-completion",
                    "--cross-file-rename",
                    "--completion-style=detailed",
                    "--header-insertion-decorators",
                    "--header-insertion=iwyu",
                    "--pch-storage=memory",
                }
            })
        end,
    },
    {
        "mfussenegger/nvim-lint",
        event = {
            "BufReadPre",
            "BufNewFile",
        },
        config = function()
            nlint = require("lint")

            nlint.linters_by_ft = {
                c = { "cpplint" },
            }

            local nlint_augroup = vim.api.nvim_create_augroup("lint", { clear = true })

            vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, {
                group = nlint_augroup,
                callback = function()
                    nlint.try_lint()
                end,
            })
        end,
    },
    {
        "stevearc/conform.nvim",
        event = {
            "BufReadPre",
            "BufNewFile",
        },
        config = function()
            local conformf = require("conform")

            conformf.setup({
                formatters_by_ft = {
                    c = { "clangd" },
                },
                format_on_save = {
                    timeout_ms = 500,
                    lsp_fallback = true,
                    async = false,
                },
            })

            vim.api.nvim_create_autocmd("BufWritePre", {
                callback = function(args)
                    require("conform").format({
                        bufnr = args.buf,
                        timeout_ms = 500,
                        lsp_fallback = true,
                        async = false,
                    })
                end,
            })
        end,
    },
    {
        "hrsh7th/nvim-cmp",
        event = "InsertEnter",
        dependencies = {
            "hrsh7th/cmp-buffer",
            "hrsh7th/cmp-path",
            "L3MON4D3/LuaSnip",
            "saadparwaiz1/cmp_luasnip",
            "rafamadriz/friendly-snippets",
            "onsails/lspkind.nvim",
        },
        config = function()
            local cmp = require("cmp")
            local luasnipc = require("luasnip")
            local lspkindc = require("lspkind")

            require("luasnip.loaders.from_vscode").lazy_load()
            cmp.setup({
                completion = {
                    completeopt = "menu,menuone,preview,noselect",
                },
                snippet = {
                    expand = function(args)
                        luasnipc.lsp_expand(args.body)
                    end,
                },
                mappings = cmp.mapping.preset.insert({
                    ['<Down>'] = function(fallback)
                        if cmp.visible() then
                          cmp.select_next_item()
                        else
                          fallback()
                        end
                    end,
                    ['<Up>'] = function(fallback)
                        if cmp.visible() then
                          cmp.select_prev_item()
                        else
                          fallback()
                        end
                    end,
                    ["<CR>"] = cmp.mapping.confirm({
                        behavior = cmp.ConfirmBehavior.Insert,
                        select = true
                    }),
                    ["<C-Up>"] = cmp.mapping(cmp.mapping.scroll_docs(-4), { "i", "c" }),
                    ["<C-Down>"] = cmp.mapping(cmp.mapping.scroll_docs(4), { "i", "c" }),
                    ["<C-Space>"] = cmp.mapping(cmp.mapping.complete(), { "i", "c" }),
                    ["<Esc>"] = cmp.mapping {
                      i = cmp.mapping.abort(),
                      c = cmp.mapping.close(),
                    },
                    ["<C-l>"] = cmp.mapping(function()
                        if luasnip.expand_or_locally_jumpable then
                            luasnip.expand_or_jump()
                        end
                    end, { "i", "s" }),
                    ["<C-h>"] = cmp.mapping(function()
                        if luasnip.locally_jumpable(-1) then
                            luasnip.jump(-1)
                        end
                    end, { "i", "s" }),
                }),

                sources = cmp.config.sources({
                    { name = "nvim_lsp" },
                    { name = "luasnip" },
                    { name = "buffer" },
                    { name = "path" },
                }),

                formatting = {
                    format = lspkindc.cmp_format({
                        maxwidth = 50,
                        ellipsis_char = "...",
                    }),
                },
            })
        end,
    },
  },
  -- Configure any other settings here. See the documentation for more details.
  -- colorscheme that will be used when installing plugins.
  install = { },
  -- automatically check for plugin updates
  checker = { enabled = true },
})

vim.keymap.set("n", "<Esc>", "<cmd>nohlsearch<cr>", { desc = "Clears search highlight with ESC" })

Expected behavior
The autocompletion works as expected, with the defined keys.
Actual behavior
It's only showing the menu and is not navigating to the entries nor selecting them.
Additional context
here is my full config in a single lua file (Is kinda minimal tbh):
vim.g.mapleader = " "
vim.g.maplocalleader = "\\"

-- Ensures syntax is enabled
vim.cmd("syntax on")

-- Show relative line numbers
vim.opt.number = true
vim.opt.relativenumber = true
vim.opt.signcolumn = "number"
vim.wo.number = true

-- I do not have a nerd font.
vim.g.have_nerd_font = false

-- Enables the mouse
vim.opt.mouse = "a"

-- Disables showing the mode (because it's on the status line)
vim.opt.showmode = false

-- Sync OS & nvim clipboards
vim.opt.clipboard = "unnamedplus"

-- Set highlight on search
vim.o.hlsearch = false

-- Enable break indent
vim.o.breakindent = true

-- Case-insensitive searching UNLESS \C or capital in search
vim.o.ignorecase = true
vim.o.smartcase = true

-- Keep signcolumn on by default
vim.wo.signcolumn = "yes"

-- Decrease update time
vim.o.updatetime = 250
vim.o.timeoutlen = 300

-- Set completeopt to have a better completion experience
vim.o.completeopt = "menuone,noselect"

-- This enables 4 spaces tabs
vim.opt.tabstop = 4
vim.opt.softtabstop = 4
vim.opt.shiftwidth = 4
vim.opt.expandtab = true

-- Smart identation
vim.opt.smartindent = true

-- Enables SwapFiles
vim.opt.swapfile = true

-- Disables Backups
vim.opt.backup = false

-- Enables Undo-dir
vim.opt.undodir = os.getenv("HOME") .. "/.vim/undodir"
vim.opt.undofile = true

-- Enables incremental highlight
vim.opt.incsearch = true

-- Ensures that has at least 8 lines at bottom or top of screen.
vim.opt.scrolloff = 8
vim.opt.signcolumn = "yes"
vim.opt.isfname:append("@-@")

vim.opt.colorcolumn = "80,160"

-- Shows the command
vim.opt.showcmd = false

-- Remove bottom command line
vim.opt.cmdheight = 0

-- Auto Resizes window
vim.api.nvim_create_autocmd("VimResized", { pattern = "*", command = "tabdo wincmd =" })

-- Make the arrow keys go to next or previous line.
-- vim.cmd([[set whichwrap+=<,>,[,] ]])

-- This enables inlay_hints on LSP in case it fails to load on the plugin conf.
vim.g.inlay_hints_visible = true

-- Enables autosaving excluding certain buffer types
function Is_excluded_buffer(buftype)
	Autosave_excluded_buftypes = {
		"terminal",
		"nofile",
		"help",
		"quickfix",
		"nowrite",
		"acwrite",
	}

	for _, excluded_type in ipairs(Autosave_excluded_buftypes) do
		if buftype == excluded_type then
			return true
		end
	end
	return false
end

vim.cmd("set autowriteall")
vim.api.nvim_create_autocmd("TextChanged", {
	pattern = "<buffer>",
	callback = function()
		local buftype = vim.bo.buftype
		if not Is_excluded_buffer(buftype) then
			vim.cmd("silent write")
		end
	end,
})
vim.api.nvim_create_autocmd("TextChangedI", {
	pattern = "<buffer>",
	callback = function()
		local buftype = vim.bo.buftype
		if not Is_excluded_buffer(buftype) then
			vim.cmd("silent write")
		end
	end,
})

-- disables the tilde at the end of buffer
vim.opt.fillchars = { eob = " " }

-- Sync current directory and browsing directory
vim.g.netrw_browse_split = 0

-- Disables banner
vim.g.netrw_banner = 0

-- Sets the window to be 30% of screen
vim.g.netrw_winsize = 30

-- Changes the copy command to be recursive
vim.g.netrw_localcopydircmd = "cp -r"

-- Enable filetype plugins
vim.cmd("filetype plugin on")

-- Enables OmniFunction AutoComplete
vim.opt.omnifunc = "syntaxcomplete#Complete"

-- Enables blinking cursor in insert mode
vim.api.nvim_command("set guicursor+=a:blinkon1")

-- Enables current line number coloring
vim.opt.cursorline = true
vim.opt.cursorlineopt = "number"

-- Configure how new splits should be opened
vim.opt.splitright = true
vim.opt.splitbelow = true

-- Sets how neovim will show the spaces.
vim.opt.list = true
vim.opt.listchars = { tab = "> ", trail = "·", nbsp = "␣" }

-- Realtime substitution preview
vim.opt.inccommand = "split"

-- AUTOCOMMANDS

-- Highlight when yanking (copying) text
vim.api.nvim_create_autocmd("TextYankPost", {
	desc = "Highlight when yanking (copying) text",
	group = vim.api.nvim_create_augroup("kickstart-highlight-yank", { clear = true }),
	callback = function()
		vim.highlight.on_yank()
	end,
})

-- Bootstrap lazy.nvim
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
  local lazyrepo = "https://github.com/folke/lazy.nvim.git"
  local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
  if vim.v.shell_error ~= 0 then
    vim.api.nvim_echo({
      { "Failed to clone lazy.nvim:\n", "ErrorMsg" },
      { out, "WarningMsg" },
      { "\nPress any key to exit..." },
    }, true, {})
    vim.fn.getchar()
    os.exit(1)
  end
end
vim.opt.rtp:prepend(lazypath)

-- Setup lazy.nvim
require("lazy").setup({
  spec = {
    {
        "nvim-treesitter/nvim-treesitter",
        build = ":TSUpdate",
        config = function ()
          local configs = require("nvim-treesitter.configs")

          configs.setup({
              ensure_installed = { "c", "lua", "vim", "vimdoc" },
              sync_install = true,
              highlight = { enable = true },
              indent = { enable = true },
            })
        end
    },
    {
        "williamboman/mason.nvim",
        opts = {
            ui = {
                icons = {
                    package_installed = "✓",
                    package_pending = "➜",
                    package_uninstalled = "✗"
                }
            },
            ensure_installed = {
                "clangd",
                "clang-tidy",
            },
        },
    },
    {"williamboman/mason-lspconfig.nvim"},
    {
        "neovim/nvim-lspconfig",
        dependencies = {
            "williamboman/mason.nvim",
            "williamboman/mason-lspconfig.nvim"
        },
        config = function()
            require("mason").setup()
            require("mason-lspconfig").setup()
            -- I've opted for a manual configuration here to have more control
            -- of the lsps settings.
            require("lspconfig").clangd.setup({
                cmd = {
                    "clangd",
                    "--background-index",
                    "-j=8",
                    "--query-driver=/usr/bin/**/clang-*,/bin/clang,/bin/clang++,/usr/bin/gcc,/usr/bin/g++",
                    "--clang-tidy",
                    "--clang-tidy-checks=*",
                    "--all-scopes-completion",
                    "--cross-file-rename",
                    "--completion-style=detailed",
                    "--header-insertion-decorators",
                    "--header-insertion=iwyu",
                    "--pch-storage=memory",
                }
            })
        end,
    },
    {
        "mfussenegger/nvim-lint",
        event = {
            "BufReadPre",
            "BufNewFile",
        },
        config = function()
            nlint = require("lint")

            nlint.linters_by_ft = {
                c = { "cpplint" },
            }

            local nlint_augroup = vim.api.nvim_create_augroup("lint", { clear = true })

            vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, {
                group = nlint_augroup,
                callback = function()
                    nlint.try_lint()
                end,
            })
        end,
    },
    {
        "stevearc/conform.nvim",
        event = {
            "BufReadPre",
            "BufNewFile",
        },
        config = function()
            local conformf = require("conform")

            conformf.setup({
                formatters_by_ft = {
                    c = { "clangd" },
                },
                format_on_save = {
                    timeout_ms = 500,
                    lsp_fallback = true,
                    async = false,
                },
            })

            vim.api.nvim_create_autocmd("BufWritePre", {
                callback = function(args)
                    require("conform").format({
                        bufnr = args.buf,
                        timeout_ms = 500,
                        lsp_fallback = true,
                        async = false,
                    })
                end,
            })
        end,
    },
    {
        "hrsh7th/nvim-cmp",
        event = "InsertEnter",
        dependencies = {
            "hrsh7th/cmp-buffer",
            "hrsh7th/cmp-path",
            "L3MON4D3/LuaSnip",
            "saadparwaiz1/cmp_luasnip",
            "rafamadriz/friendly-snippets",
            "onsails/lspkind.nvim",
        },
        config = function()
            local cmp = require("cmp")
            local luasnipc = require("luasnip")
            local lspkindc = require("lspkind")

            require("luasnip.loaders.from_vscode").lazy_load()
            cmp.setup({
                completion = {
                    completeopt = "menu,menuone,preview,noselect",
                },
                snippet = {
                    expand = function(args)
                        luasnipc.lsp_expand(args.body)
                    end,
                },
                mappings = cmp.mapping.preset.insert({
                    ['<Down>'] = function(fallback)
                        if cmp.visible() then
                          cmp.select_next_item()
                        else
                          fallback()
                        end
                    end,
                    ['<Up>'] = function(fallback)
                        if cmp.visible() then
                          cmp.select_prev_item()
                        else
                          fallback()
                        end
                    end,
                    ["<CR>"] = cmp.mapping.confirm({
                        behavior = cmp.ConfirmBehavior.Insert,
                        select = true
                    }),
                    ["<C-Up>"] = cmp.mapping(cmp.mapping.scroll_docs(-4), { "i", "c" }),
                    ["<C-Down>"] = cmp.mapping(cmp.mapping.scroll_docs(4), { "i", "c" }),
                    ["<C-Space>"] = cmp.mapping(cmp.mapping.complete(), { "i", "c" }),
                    ["<Esc>"] = cmp.mapping {
                      i = cmp.mapping.abort(),
                      c = cmp.mapping.close(),
                    },
                    ["<C-l>"] = cmp.mapping(function()
                        if luasnip.expand_or_locally_jumpable then
                            luasnip.expand_or_jump()
                        end
                    end, { "i", "s" }),
                    ["<C-h>"] = cmp.mapping(function()
                        if luasnip.locally_jumpable(-1) then
                            luasnip.jump(-1)
                        end
                    end, { "i", "s" }),
                }),

                sources = cmp.config.sources({
                    { name = "nvim_lsp" },
                    { name = "luasnip" },
                    { name = "buffer" },
                    { name = "path" },
                }),

                formatting = {
                    format = lspkindc.cmp_format({
                        maxwidth = 50,
                        ellipsis_char = "...",
                    }),
                },
            })
        end,
    },
	{
		'stevearc/oil.nvim',
		dependencies = { "nvim-tree/nvim-web-devicons" },
		---@module 'oil'
		---@type oil.SetupOpts
		opts = {},
	},
	{
		'nvim-telescope/telescope.nvim',
		dependencies = { 'nvim-lua/plenary.nvim' },
		opts = {},
	},
  },
  -- Configure any other settings here. See the documentation for more details.
  -- colorscheme that will be used when installing plugins.
  install = { },
  -- automatically check for plugin updates
  checker = { enabled = true },
})

vim.keymap.set('n', '<C-f>', require('telescope.builtin').find_files, { desc = 'Telescope find files' })

-- Move focus to window
vim.keymap.set("n", "<A-Left>", "<C-w><C-h>", { desc = "Focus on the left window" })
vim.keymap.set("n", "<A-Right>", "<C-w><C-l>", { desc = "Focus on the right window" })
vim.keymap.set("n", "<A-Down>", "<C-w><C-j>", { desc = "Focus on the lower window" })
vim.keymap.set("n", "<A-Up>", "<C-w><C-k>", { desc = "Focus on the upper window" })

vim.keymap.set("n", "<Esc>", "<cmd>nohlsearch<cr>", { desc = "Clears search highlight with ESC" })

vim.keymap.set("n", "<C-e>", "<CMD>Oil<CR>", { desc = "Open parent directory" })

vim.cmd.colorscheme('habamax')

It was a typo, mappings should be mapping.

marking as solved


text:
Feature request: debounce triggering auto-completion

The older nvim-compe had these options, and I loved them. In fact, I resisted switching to nvim-cmp for so long because I had tweaked the completion behavior to perfection and to be less “annoying” using these options. Can you bring this options back?

Please explain how annoying with current setting.

Isn't the keyword length option enough?
Sorry. I am careful about exposing the options as public.
I can add this but I want to know the rational reason.

Isn't the keyword length option enough?

No, because I use cmp to trigger local snippets, which I prioritize above all sources.
The behavior I want is that when I'm typing, I don't want the completion window updating with new items from sources until I stop typing for 1.5 seconds. Setting THROTTLE_TIME=1500 and SOURCE_TIMEOUT=100 helps me achieve this.
This for me creates  a less distracting and more predictable experience. It gives me a little control over when and how the completion lists gets populated. It also gives tabnine enough time to send me useful completions.
I find the default behavior of cmp too aggressive and noisy. It updates the list too quickly and sometimes in the middle of me trying to select an item it randomly inserts a new item.

Sorry. I am careful about exposing the options as public. I can add this but I want to know the rational reason.

Understood.

I'd tried THROTTLE_TIME=1500 and SOURCE_TIMEOUT=100. It will cause the strange behavior...

I hope to know,the ideal behaivior.

Hmm, interesting. Works perfectly for me. I can see how SOURCE_TIMEOUT can cause issues for slow lsp servers. But I'm perfectly fine ignoring slow servers.
The behavior I want is to delay querying the sources for new items until I stop typing. In other words, when I'm typing, I don't want any query requests sent to completion sources. Requests can be sent after I stop typing, but not when I'm typing.
This is so that the completion windows doesn't abruptly add new items when I'm typing. This is what creates the “distracting noise” for me. A delay of around 1.5 seconds is perfect for me, especially with tabnine.
I thought THROTLLE_TIME achieved this, but I haven't really studied the code. So my assumptions may be wrong.
In summary, I want an option that only updates the completion items when I'm not typing. When I'm typing, just filter what's already available in the completion window. Only add new items to the completion window after I stop typing, if it makes sense.
I hope you understand what I'm trying to do.

Therefore, the "debounce" function is required.
Hmm ... for now, I'll provide a workaround for debounce.
It seems that we have to think continuously.

DEBOUNCE is the word I'm looking for.
Yes, a debounce option when typing will go a long way. Especially since some lsp sources just love to through a lot of irrelevant items at you. I had to set max_item_count = 5 because some lsp servers were driving me crazy. Thanks for that option, by the way, it's a lifesaver. :-)
I use a combination of THROTTLE_TIME and SOURCE_TIMEOUT to mimic debouncing. I've settled on 1000 and 200 respectively, and so far so good.

The workaround.
lua << EOF
local cmp = require "cmp"
cmp.setup {
  completion = {
    autocomplete = false,
  },
  snippet = {
    expand = function(args)
      vim.fn["vsnip#anonymous"](args.body)
    end,
  },

  mapping = {
    ['<CR>'] = cmp.mapping.confirm({ select = true }),
  },

  sources = {
    { name = "buffer" },
  },
}
EOF

autocmd TextChangedI * call s:on_text_changed()
let s:timer_id = 0
function! s:on_text_changed() abort
  function! s:invoke() abort closure
lua << EOF
    local cmp = require('cmp')
    cmp.complete({ reason = cmp.ContextReason.Auto })
EOF
  endfunction
  call timer_stop(s:timer_id)
  let s:timer_id = timer_start(800, { -> s:invoke() })
endfunction

https://github.com/hrsh7th/nvim-cmp/issues/435
https://github.com/hrsh7th/nvim-cmp/issues/266

For the benefit of those who want the workaround in lua, you can use the example below. You can place debounce.lua in your lua folder and call it from your cmp configuration.
-- debounce.lua

local M = {}

local cmp = require("cmp")
local timer = vim.loop.new_timer()

local DEBOUNCE_DELAY = 1000

function M.debounce()
  timer:stop()
  timer:start(
    DEBOUNCE_DELAY,
    0,
    vim.schedule_wrap(function()
      cmp.complete({ reason = cmp.ContextReason.Auto })
    end)
  )
end

return M

You can experiment with DEBOUNCE_DELAY to see what works for you.
Next, place the following snippet after cmp.setup(...).

-- NOTE: change "plugin.cmp.debounce" to location of debounce.lua
-- If it's in the lua folder, then change to "debounce"

vim.cmd([[
  augroup CmpDebounceAuGroup
    au!
    au TextChangedI * lua require("plugin.cmp.debounce").debounce()
  augroup end
]])

Are you planning on adding a config option here? I would love a debounce just mentally. It's taxing and distracting for me to see the window constantly popping up and shifting around. I find myself having to look away from the screen when I'm typing so it's easier to hold focus on what I'm thinking about.
I'm currently trying the steps above but haven't yet got it working, though I'm confident I will be able to. But if this were just a simple config option, that'd have made my afternoon a lot easier :)
I hope you consider (or continue to support?) adding a flag for it. Thank you!

For the benefit of those who want the workaround in lua, you can use the example below. You can place debounce.lua in your lua folder and call it from your cmp configuration.
-- debounce.lua

local M = {}

local cmp = require("cmp")
local timer = vim.loop.new_timer()

local DEBOUNCE_DELAY = 1000

function M.debounce()
  timer:stop()
  timer:start(
    DEBOUNCE_DELAY,
    0,
    vim.schedule_wrap(function()
      cmp.complete({ reason = cmp.ContextReason.Auto })
    end)
  )
end

return M

You can experiment with DEBOUNCE_DELAY to see what works for you.
Next, place the following snippet after cmp.setup(...).
-- NOTE: change "plugin.cmp.debounce" to location of debounce.lua
-- If it's in the lua folder, then change to "debounce"

vim.cmd([[
  augroup CmpDebounceAuGroup
    au!
    au TextChangedI * lua require("plugin.cmp.debounce").debounce()
  augroup end
]])

Also, don't forget to set autocomplete = false in cmp.setup(...).
local cmp = require "cmp"
cmp.setup {
  ...
  completion = {
    autocomplete = false,
    ...
  },
...

Incredible performance booster. I thought that nvim-cmp had already a debounce mechanism behind the scenes???
Anyhow, thank you, thank you!

This is different, it postpones request to cmp for completion.

This is different, it postpones request to cmp for completion.

Yes, understood.
I didn't dig into the code so I don't have a picture of how it's built, but the performance issue was real.
This really helped me.
I have a light config, not many plugins, and I was having serious problems when coding on medium-large typescript codebases...

Now, We have performance configuration section. So I can add this feature.
Rough sketch.
cmp.setup {
  performance = {
    trigger_debounce_time = 500
  }
}

The reason for me wanting this feature was the lags while typing continuously with suggestions kept coming up - due to spell source - which probably why other people want this feature as well. I just stumbled upon a fix for me which was setting nolazyredraw as below.
vim.o.lazyredraw = false -- or
vim.cmd [[ set nolazyredraw ]]

So mine had been set to lazyredraw for some reason without me noticing and now the lag is gone  (at least the most of it) by explicit vim.om.lazyredraw = false.

For the benefit of those who want the workaround in lua, you can use the example below. You can place debounce.lua in your lua folder and call it from your cmp configuration.
-- debounce.lua

local M = {}

local cmp = require("cmp")
local timer = vim.loop.new_timer()

local DEBOUNCE_DELAY = 1000

function M.debounce()
  timer:stop()
  timer:start(
    DEBOUNCE_DELAY,
    0,
    vim.schedule_wrap(function()
      cmp.complete({ reason = cmp.ContextReason.Auto })
    end)
  )
end

return M

That is awesome. I jut noticed what cmp popup wont show if you for example use  o - create new line below, and go into insert mode.  IT seems ahat use   cmp.ContextReason.Auto will ignore empty lines  (like one created with o), thus I created slightly different condition:
  if not cmp.visible() and vim.fn.mode() == 'i' then
    -- Auto takes keyword_length into account, (wont ignore existing letters - unlike manual) but wont show anything if no letter in line. Good when line is not empty.
    -- Manual will show popup even if no letter, but then if user types few leters - the get  ignored. Good for empty lines.
    -- check if current line has any letters : if not use Manual
    local current_line = vim.api.nvim_get_current_line()
    local has_letters = string.find(current_line, "%a") -- "%a" matches any alphabet character (equivalent to [a-zA-Z])
    if has_letters then
      cmp.complete({ reason = cmp.ContextReason.Auto }) -- without reason, it will ignore letters before cursor...
    else
      cmp.complete({ reason = cmp.ContextReason.Manual }) -- without reason, it will ignore letters before cursor...
    end

    -- cmp.complete()  -- gives 'old' suggestion (like it does not see characters types after first bounce... even thought using bounce_trailing)
  end

Do we still need to use the workaround? The constant jumping around of boxes all over my editor makes me very distracted. Sometimes I can't see variable names from a function while typing.


text:
Update mockito-scala to 1.17.22

About this PR
📦 Updates org.mockito:mockito-scala from 1.17.0 to 1.17.22
📜 GitHub Release Notes - Version Diff
Usage
✅ Please merge!
I'll automatically update this PR to resolve conflicts as long as you don't change it yourself.
If you'd like to skip this version, you can just close this PR. If you have any feedback, just mention me in the comments below.
Configure Scala Steward for your repository with a .scala-steward.conf file.
Have a fantastic day writing Scala!

⚙ Adjust future updates
Add this to your .scala-steward.conf file to ignore future updates of this dependency:
updates.ignore = [ { groupId = "org.mockito", artifactId = "mockito-scala" } ]

Or, add this to slow down future updates of this dependency:
dependencyOverrides = [{
  pullRequests = { frequency = "30 days" },
  dependency = { groupId = "org.mockito", artifactId = "mockito-scala" }
}]

labels: test-library-update, early-semver-patch, semver-spec-patch, commit-count:1

Superseded by #151.

source: gharchive/pull-request

repo: hseeberger/akkluster


text:
Converting between Array and AFArray

At the moment it does not seem possible to convert an AFArray to an Array type and vice versa.  It would to nice to be able to do this so that the matrices generated by ArrayFire can be fed into other julia functions.

Thanks for your feedback.
Use to_host function for converting AFArray to Array.

authors: RJDennis hshindo


text:
feat: scale overload

:rocket: Enhancements

Add fallback overload for createScale

I think this may not work as the last overload, I only got it to work as
the first overload 🤔
https://github.com/hshoff/vx/pull/789#discussion_r477827250
On Thu, Aug 27, 2020, 12:09 PM Krist Wongsuphasawat <
notifications@github.com> wrote:

Merged #791 https://github.com/hshoff/vx/pull/791 into master.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/hshoff/vx/pull/791#event-3701036137, or unsubscribe
https://github.com/notifications/unsubscribe-auth/ABCJZCM7ODSI7NNXUMY3XWDSC2VQDANCNFSM4QMIFTWA
.

authors: kristw williaster

repo: hshoff/vx


text:
Welcome to GitHub Pages | hsqzggg.github.io

https://hsqzggg.github.io/
blog

gitalk评论1

@hsqzggg
gitalk评论1

1212


text:
🛑 blog is down

In 80709d7, blog (https://blog.imzhp.com) was down:

HTTP code: 0
Response time: 0 ms

Resolved: blog is back up in ad7ef4e after 3 hours, 11 minutes.

repo: htmambo/upptime


text:
[suggestion] Move README.md to FAQ.md

Knowing why the interfaces are the way they are is worth reading – however, only for potential contributors, not potential consumers.
The README.md is displayed at packagist.org/…/http-middleware and github. In my opinion, potential consumers will be deterred by the discussion about the pros and cons of the chosen design.
Personally, I think readmes should be as short and concise as possible. They should be optimally designed and completely dedicated to customer needs, e.g.:

The namespace should be the title: # Interop\Http\Middleware.
A small prelude, which states

this packages provides the official interfaces of the PSR-15
PSR-15 is a proposal and is still undergoing changes

A tiny # Install section:

composer require http-interop/http-middleware

A # Usage section: a tiny code snippet, which

is easy to understand
also contains namespace stuff: use Interop\Http\Middleware\ServerMiddlewareInterface; etc.
can be easily copied and modified by potential consumers

A small description of the API – maybe in this case just the interface code including its docblocks.
Refer to the current readme as FAQ.md
Optionally mentioning contributors (consumers may want to contact you)
A tiny # License section:

MIT © PHP-FIG

@shadowhand: I'm willing to create a PR for that.

This probably makes sense. Replacing the README with META might not be ideal in the long term.
Any objections @http-interop/http-middleware-contributors ?

README has been removed and points to FIG for documentation.

authors: schnittstabil shadowhand

repo: http-interop/http-middleware


text:
Ecstatic with tests

Please ensure that your pull request fulfills these requirements:

[x] The pull request is being made against the master branch
[x] Tests for the changes have been added (for bug fixes / features)

What is the purpose of this pull request?
Remove dependency on ecstatic -- see #631 (this is based on @thornjad 's work, only the test code was fixed here + hack from #569 replaced by a nicer fix  inside Ecstatic)
Fixes #568, fixes #518, fixes #35

@thornjad all green 🎉 https://travis-ci.com/github/zbynek/http-server/builds/231702777
I dropped Node 6 from the list of CI tested platforms.

:tada: thank you so much for the PR! I'll fit in looking over it whenever I get chances.
For the hack from #569, do you know where the fix inside ecstatic is? I don't remember hearing anything about it, but then again, ecstatic has gone through some drama that drowned out everything else.

For #569 I've added the replacement into decodePathname directly. I think this way it allows you to have \ in filenames on Linux/Mac (as long as you pass them as %5C in URL) and everything gets normalized to / on windows.
Before this change the tests were failing on Windows with infinite redirect (because the hack was only active when loading http-server, and the tests only load core). Now the tests are passing on Windows which suggests that the fix works, but please double check that it makes sense.

For the conflict, I'd say just merge master, rm package-lock.json and npm i, that should give us a good package-lock again

Didn't realize I had push permissions on your fork! I just merged master in. I'll see if I can get travis hooked up again so we can see tests easily

Eh, looks like I don't have enough permissions to add the new Travis configuration (we were using a now-deprecated version)

Huh, turns out Travis is paid now. I guess I'll see what we can get from it in this PR, then move to something better before the 0.13 release.
On my latest merge, it looks like fsevents is doing some complaining on non-Mac hosts, do you have any insight on that? It runs fine on my local Ubuntu system, so I'm not able to repro

@thornjad travis is running on my branch. I changed the config to to use npm@7, it worked for all OS/Node combos except Win+Node 8: https://travis-ci.com/github/zbynek/http-server/builds/232553767
The last commit removes this combo from test matrix, I didn't manage to test it on Travis though (ran out of the free credits...), maybe you have more luck with your account.

@thornjad do you want to merge as is or do you want to figure out free CI first?

Eh, sorry yeah CI is the issue, I've run out of credits on Travis too. I'm thinking maybe yeah I'll just merge and figure out CI before releasing to npm

authors: thornjad zbynek

repo: http-party/http-server


text:
Added option for custom headers

This PR adds an option to provide custom headers.
Relevant issues
Resolves #884
Contributor checklist

[ ] Provide tests for the changes (unless documentation-only)
[X] Documented any new features, CLI switches, etc. (if applicable)

[X] Server --help output
[X] README.md
[X] doc/http-server.1 (use the same format as other entries)

[X] The pull request is being made against the master branch

Maintainer checklist

[ ] Assign a version triage tag
[ ] Approve tests if applicable

I was coming back to make tests for this PR and fix the fact it doesn't handle colons in the header values, but I saw there was an other PR https://github.com/http-party/http-server/pull/887 which uses the curl approach to adding headers. Which approach would be prefered? should I just close this one if we'd rather use the curl-based one?

I was coming back to make tests for this PR and fix the fact it doesn't handle colons in the header values, but I saw there was an other PR #887 which uses the curl approach to adding headers. Which approach would be prefered? should I just close this one if we'd rather use the curl-based one?

Thanks for bringing the dupe to my attention. I like the idea of using known conventions where possible. Let's move focus to #887, and I've also opened discussion #899 so we can talk about superset syntax (i.e. maybe we allow semicolon-separated values as well if it doesn't conflict with curl's convention, because that seems more convenient to me).


text:
🛑 DMHY is down

In 6fd6e86, DMHY (https://share.dmhy.org) was down:

HTTP code: 500
Response time: 408 ms

Resolved: DMHY is back up in 480b687 after 5 hours, 37 minutes.


text:
ClientMetrics will mark metrics before connection has closed

Metrics are being recorded here before we actually close the connection: https://github.com/http4s/http4s/blob/80df97e1fdb1d764059acafcd1f4331135964560/client/src/main/scala/org/http4s/client/middleware/Metrics.scala#L46
The finalizer for the client.run won't run until after the metrics have been marked. When you use the Resource you'll mark your metrics before you've finished consuming the body, which could potentially skew the metrics.
A fix could be marking the metrics as a part of the client.run's Resource release function.
Conversation in gitter: https://gitter.im/http4s/http4s?at=5beef2645f5c925040699ecb

This is something I can look into fixing.


text:
Strict query parameter matching

if I have this case in my HttpService
object OptionalYearQueryParamMatcher extends OptionalQueryParamDecoderMatcher[Int]("year")
...
case GET -> Root / "temperature" :? OptionalYearQueryParamMatcher(maybeYear) =>

it matches requests like http://localhost/temperature or http://localhost/temperature?year=1 and that's fine.
but it also matches http://localhost/temperature?superfluous=someval or http://localhost/temperature?year=1&superfluous=someval
is there a way to do strict matching on the query parameters that doesn't allow any superfluous parameters to be present?

Could you please say why you added RFC, @rossabaker? Does the RFC talk about this topic?

The label literally means request for comments :)
To get input from users on how this case should be handles so everyone's happy.

Thanks, @aeons.
In my 2 years using http4s professionally, I've never had a concern or need to handle what @sideeffffect noted:

is there a way to do strict matching on the query parameters that doesn't allow any superfluous parameters to be present?

The workaround with the if-guard seems to be sufficient here.

authors: aeons kevinmeredith rossabaker sideeffffect


text:
Encoder corrupts paths with unlucky letters

This part of the encoder changes the case of letters in paths it is encoding, for reasons not entirely clear.
            val c1 = in.get().toChar
            if (CharPredicate.HexDigit(c1)) {
              out.put(c0.toUpper)
              out.put(c1.toUpper)
            } else {

c0 and c1 are characters read from the input stream. If toSkip('%') is true, then % followed by two characters in the a-f range will see those letters flipped to upper case in the encoded path. (That's not what "skip" means!)
This is less directly relevant to me now because you just made the object containing this method private to the library (it was being called directly from quasar) but I thought you'd want to know.

The uppercasing is for normalization.  Quoth the RFC, "For consistency, URI producers and normalizers should use uppercase hexadecimal digits for all percent-encodings."  It would be good manners to mention that this happens.
It is indeed a bug in 0.14.x.  The old implementation capitalized percent encodings via a regex before encoding.  v0.14.6:
scala> urlEncode("%ab")
res4: String = %25AB

The code quoted above works in one pass:
scala> urlEncode("%ab")
res1: String = %25ab

urlEncode("%ab", toSkip = Set('%'))
res2: String = %AB

I didn't expect external consumers, but I'm happy to make this public again.  java.net.URLEncode only works for form encoding, whereas this supports other contexts, such as URI paths.  It would be better to have methods for the common use cases, saving callers the homework for the correct values of spaceIsPlus and toSkip.
In any event, I'll fix the bug in 0.14.  Thanks for the report.

authors: paulp rossabaker


text:
在case1中output一个变量值，然后在case2中，使用这个变量值作为请求参数和预期结果，预期结果中值显示是：LazyString($audid)

case2中，发出请求正确，但是预期结果出错，把LazyString($audid)当成了预期结果，导致判断失败

audid是output的参数值
换了两个浏览器都上传不了图片，尴尬

可以试试在case2里面设置一个变量来接收$audid，再对这个变量进行check。

按照上面的方法解决了，感谢

repo: httprunner/httprunner


text:
桌面小工具。

嗨，想问问，作者可有计划开发桌面小工具？谢谢。

桌面小工具是从客户端角度出发的，肯定不是框架提供

谢谢您。看样子我们应该是要从零开发。因为 HOME APP WIDGET 需要 RemoteView，应该是不能重复采用现在的核心代码 MonthView - https://github.com/huanghaibin-dev/CalendarView/blob/master/calendarview/src/main/java/com/haibin/calendarview/MonthView.java

authors: huanghaibin-dev yccheok

repo: huanghaibin-dev/CalendarView


text:
Setup working Apache + wssh , httpS at the front and ws

Hi there, just if it helps, my setup is a front web server running HTTPs and wssh inside on a private IP.
This setup is working with Apache 2 under Debian 10 and wssh in Ubuntu 20.04.3 . The URL served is SITE/webssh/
  <Location /webssh>
    RewriteEngine On
    ProxyPreserveHost On
    RewriteCond %{HTTP:Upgrade} =websocket [NC]
    RewriteRule /webssh(.) ws://10.110.100.3:8888/$1 [P,L]
    RewriteRule /ws* ws://10.110.100.3:8888/ws$1 [P,L]
    RewriteCond %{HTTP:Upgrade} !=websocket [NC]
    RewriteRule /webssh(.) http://10.110.100.3:8888/$1 [P,L]
    ProxyPass http://10.110.100.3:8888
    ProxyPassReverse http://10.110.100.3:8888
  </Location>

The line: RewriteRule /ws* its very important because as you are using HTTPS at the front-end , the app is calling WSS (Secure websockets) so you need it.
If it helps.

Dear sir
THANK YOU VERY MUCH

repo: huashengdun/webssh


text:
Help how to run streamDM

I need help how to run this project in eclipsce
or it should run from cmd
thx in advance

Hello, you could follow the steps provided here : http://huawei-noah.github.io/streamDM/docs/GettingStarted.html
By the way, before being able to work with the "Compiling the code", you should make sure that you have SCALA and SPARK on your computer.
If you don't, please follow the tutorial here to install those two: https://www.tutorialspoint.com/apache_spark/apache_spark_installation.htm
Then, to run the first script (spark.sh), you should need some configurations:

Modify $SPARK_HOME:

Open ~./bash_profile (on MacOS) or ~./bashrc by some text editor
Add this line into that file: export SPARK_HOME="/usr/local/spark"

Run the script.

That's how you could make the code runnable.

repo: huawei-noah/streamDM


text:
SPRM TSNE Clustering Issue

See https://hubmapconsortium.slack.com/archives/CUJDR98MU/p1629215158011000?thread_ts=1629210686.004000&cid=CUJDR98MU for the visualization - could just be jumbled ids, or could be indicative of an issue.

Fixed this issue.

authors: ilan-gold tCeZ

repo: hubmapconsortium/ingest-pipeline


text:
Remove swagger endpoints from swagger json

Describe what bug you fixed
After merge #80, other routes which not static routes but under swagger blueprint also be documented. This PR fixes this issue and also rename the variable name of the swagger blueprint to avoid confisions.
Checklist

[x] I've already read the contributing guide.
[x] I've run all tests and make sure all exists test cases are passed.
[x] I've make sure this PR works with Sanic-18.12 and Python-3.5.

Put this PR with #109 together to avoid missing tests.

repo: huge-success/sanic-openapi


text:
Ingredients/Foods to add

[ ] batter = corn_meal + flour + egg + bowl
[x] chocolate_milk = cocoa_powder + milk
[x] dough = flour + water + egg + salt
[ ] cupcakes
[ ] creamer = sugar + milk
[ ] fried_chicken = chicken + batter
[ ] calamari = squid + batter (?)
[ ] (protein)_cheese_fries = cheese + fries + protein of some sort (chili/bacon or what-have-you)
[ ] brownies = cocoa + eggs + flour (maybe designed like cosmic brownies)
[ ] bucket_of_cereal = bucket of milk + cereal
[ ] pepperoni = uncooked_pork + uncooked_beef + salt
[ ] pizza = dough + tomato_sauce + cheese + pepperoni
[ ] macaroni_n_cheese = macaroni + cheese

I'm sure this list isn't even half of what we discussed, but wanted to get a list down nonetheless
Originally by @He-Is-Man

Shuffled around some things to add more options for us in the future. Of note:

removed pizza sauce - we can just use tomato sauce in the recipe
moved noodles to be a mill recipe - so we can have more than one type of noodle
added dough & pizza

Shuffled around some things to add more options for us in the future. Of note:

removed pizza sauce - we can just use tomato sauce in the recipe
moved noodles to be a mill recipe - so we can have more than one type of noodle
added dough & pizza

Some of the big dev hurdles right now:

Mill
Salt
Tomato, Corn, Rice & Coffee Plants

The rest of these things are low hanging fruits. I'm considering separating bits of this list out into more manageable chunks for devs.

Some of the big dev hurdles right now:

Mill
Salt
Tomato, Corn, Rice & Coffee Plants

The rest of these things are low hanging fruits. I'm considering separating bits of this list out into more manageable chunks for devs.

1 and 2 are complete, adding back some additional items

1 and 2 are complete, adding back some additional items


text:
huge是否支持慢查询语句的标记?

Expected behavior 期望表现
期望huge能有类似mysql的那种慢查询开启选项，这样可以优化自己的查询语句
Actual behavior 实际表现
有慢查询
Steps to reproduce the problem 复现步骤
Status of loaded data 数据状态
Vertex/Edge summary 数据量
Vertex/Edge example 数据示例
Schema(VertexLabel, EdgeLabel, IndexLabel) 元数据结构
Specifications of environment 环境信息

hugegraph version: {like v0.7.4}
operating system: {like centos 7.4, 32 CPUs, 64G RAM}
hugegraph backend: {like cassandra 3.10, cluster with 20 nodes, 3 x 1TB HDD disk each node}

@no13bus 期待你的贡献^-^

好的

repo: hugegraph/hugegraph


text:
license

please include a license or copying file as this currently is not covered under any license.

I have included the license. Thanks.

authors: Justinzobel hugegreenbug

repo: hugegreenbug/libevdevc


text:
Keys mismatch: make error message more informative

Is your feature request related to a problem? Please describe.
When loading a dataset from disk with a defect in its dataset_info.json describing its features (I don’t know when/why/how this happens but it deserves its own issue), you will get an error message like:
ValueError: Keys mismatch: between {'bar': Value(dtype='int64', id=None)} and {'foo': Value(dtype='int64', id=None)}
Which is fine when you have only a few features like in the example but it gets very hard to read when you have a lot of features in your dataset.
Describe the solution you'd like
The error message should give the difference between the features (what keys are in A but missing in B and vice-versa). It should also tell which keys are inferred from dataset.arrow and which come from dataset_info.json.
Willing to help :)

Good idea ! I think this can be improved in Features.reorder_fields_as() indeed at
https://github.com/huggingface/datasets/blob/7feeb5648a63b6135a8259dedc3b1e19185ee4c7/src/datasets/features/features.py#L1739-L1740
Is it something you would be interested in contributing ?

Is this open to work on? I'd love to take on this as my first issue.

Hi @daspartho I’ve opened a PR #4919
I don’t think there’s much left to do

ok : )

authors: PaulLerner daspartho lhoestq

repo: huggingface/datasets


text:
add wisesight_sentiment

Add wisesight_sentiment Social media messages in Thai language with sentiment label (positive, neutral, negative, question)
Model Card:
YAML tags:
annotations_creators:

expert-generated
language_creators:
found
languages:
th
licenses:
cc0-1.0
multilinguality:
monolingual
size_categories:
10K<n<100K
source_datasets:
original
task_categories:
text-classification
task_ids:
sentiment-classification

Dataset Card for wisesight_sentiment
Table of Contents

Dataset Description

Dataset Summary
Supported Tasks
Languages

Dataset Structure

Data Instances
Data Fields
Data Splits

Dataset Creation

Curation Rationale
Source Data
Annotations
Personal and Sensitive Information

Considerations for Using the Data

Social Impact of Dataset
Discussion of Biases
Other Known Limitations

Additional Information

Dataset Curators
Licensing Information
Citation Information

Dataset Description

Homepage: https://github.com/PyThaiNLP/wisesight-sentiment
Repository: https://github.com/PyThaiNLP/wisesight-sentiment
Paper:
Leaderboard: https://www.kaggle.com/c/wisesight-sentiment/
Point of Contact: https://github.com/PyThaiNLP/

Dataset Summary
Wisesight Sentiment Corpus: Social media messages in Thai language with sentiment label (positive, neutral, negative, question)

Released to public domain under Creative Commons Zero v1.0 Universal license.
Labels: {"pos": 0, "neu": 1, "neg": 2, "q": 3}
Size: 26,737 messages
Language: Central Thai
Style: Informal and conversational. With some news headlines and advertisement.
Time period: Around 2016 to early 2019. With small amount from other period.
Domains: Mixed. Majority are consumer products and services (restaurants, cosmetics, drinks, car, hotels), with some current affairs.
Privacy:

Only messages that made available to the public on the internet (websites, blogs, social network sites).
For Facebook, this means the public comments (everyone can see) that made on a public page.
Private/protected messages and messages in groups, chat, and inbox are not included.

Alternations and modifications:

Keep in mind that this corpus does not statistically represent anything in the language register.
Large amount of messages are not in their original form. Personal data are removed or masked.
Duplicated, leading, and trailing whitespaces are removed. Other punctuations, symbols, and emojis are kept intact.
(Mis)spellings are kept intact.
Messages longer than 2,000 characters are removed.
Long non-Thai messages are removed. Duplicated message (exact match) are removed.

More characteristics of the data can be explore this notebook

Supported Tasks and Leaderboards
Sentiment analysis / Kaggle Leaderboard
Languages
Thai
Dataset Structure
Data Instances
{'category': 'pos', 'texts': 'น่าสนนน'}
{'category': 'neu', 'texts': 'ครับ #phithanbkk'}
{'category': 'neg', 'texts': 'ซื้อแต่ผ้าอนามัยแบบเย็นมาค่ะ แบบว่าอีห่ากูนอนไม่ได้'}
{'category': 'q', 'texts': 'มีแอลกอฮอลมั้ยคะ'}

Data Fields

texts: texts
category: sentiment of texts ranging from pos (positive; 0), neu (neutral; 1), neg (negative; 2) and q (question; 3)

Data Splits

train
valid
test

# samples
21628
2404
2671

# neu
11795
1291
1453

# neg
5491
637
683

# pos
3866
434
478

# q
476
42
57

avg words
27.21
27.18
27.12

avg chars
89.82
89.50
90.36

Dataset Creation
Curation Rationale
Originally, the dataset was conceived for the In-class Kaggle Competition at Chulalongkorn university by Ekapol Chuangsuwanich (Faculty of Engineering, Chulalongkorn University). It has since become one of the  benchmarks for sentiment analysis in Thai.
Source Data
Initial Data Collection and Normalization

Style: Informal and conversational. With some news headlines and advertisement.
Time period: Around 2016 to early 2019. With small amount from other period.
Domains: Mixed. Majority are consumer products and services (restaurants, cosmetics, drinks, car, hotels), with some current affairs.
Privacy:

Only messages that made available to the public on the internet (websites, blogs, social network sites).
For Facebook, this means the public comments (everyone can see) that made on a public page.
Private/protected messages and messages in groups, chat, and inbox are not included.
Usernames and non-public figure names are removed
Phone numbers are masked (e.g. 088-888-8888, 09-9999-9999, 0-2222-2222)
If you see any personal data still remain in the set, please tell us - so we can remove them.

Alternations and modifications:

Keep in mind that this corpus does not statistically represent anything in the language register.
Large amount of messages are not in their original form. Personal data are removed or masked.
Duplicated, leading, and trailing whitespaces are removed. Other punctuations, symbols, and emojis are kept intact.
(Mis)spellings are kept intact.
Messages longer than 2,000 characters are removed.
Long non-Thai messages are removed. Duplicated message (exact match) are removed.

Who are the source language producers?
Social media users in Thailand
Annotations
Annotation process

Sentiment values are assigned by human annotators.
A human annotator put his/her best effort to assign just one label, out of four, to a message.
Agreement, enjoyment, and satisfaction are positive. Disagreement, sadness, and disappointment are negative.
Showing interest in a topic or in a product is counted as positive. In this sense, a question about a particular product could has a positive sentiment value, if it shows the interest in the product.
Saying that other product or service is better is counted as negative.
General information or news title tend to be counted as neutral.

Who are the annotators?
Outsourced annotators hired by Wisesight (Thailand) Co., Ltd.
Personal and Sensitive Information

We trying to exclude any known personally identifiable information from this data set.
Usernames and non-public figure names are removed
Phone numbers are masked (e.g. 088-888-8888, 09-9999-9999, 0-2222-2222)
If you see any personal data still remain in the set, please tell us - so we can remove them.

Considerations for Using the Data
Social Impact of Dataset

wisesight_sentiment is the first and one of the few open datasets for sentiment analysis of social media data in Thai
There are risks of personal information that escape the anonymization process

Discussion of Biases

A message can be ambiguous. When possible, the judgement will be based solely on the text itself.

In some situation, like when the context is missing, the annotator may have to rely on his/her own world knowledge and just guess.
In some cases, the human annotator may have an access to the message's context, like an image. These additional information are not included as part of this corpus.

Other Known Limitations

The labels are imbalanced; over half of the texts are neu (neutral) whereas there are very few q (question).
Misspellings in social media texts make word tokenization process for Thai difficult, thus impacting the model performance

Additional Information
Dataset Curators
Thanks PyThaiNLP community, Kitsuchart Pasupa (Faculty of Information Technology, King Mongkut's Institute of Technology Ladkrabang), and Ekapol Chuangsuwanich (Faculty of Engineering, Chulalongkorn University) for advice. The original Kaggle competition, using the first version of this corpus, can be found at https://www.kaggle.com/c/wisesight-sentiment/
Licensing Information

If applicable, copyright of each message content belongs to the original poster.
Annotation data (labels) are released to public domain.
Wisesight (Thailand) Co., Ltd. helps facilitate the annotation, but does not necessarily agree upon the labels made by the human annotators. This annotation is for research purpose and does not reflect the professional work that Wisesight has been done for its customers.
The human annotator does not necessarily agree or disagree with the message. Likewise, the label he/she made to the message does not necessarily reflect his/her personal view towards the message.

Citation Information
Please cite the following if you make use of the dataset:
Arthit Suriyawongkul, Ekapol Chuangsuwanich, Pattarawat Chormai, and Charin Polpanumas. 2019. PyThaiNLP/wisesight-sentiment: First release. September.
BibTeX:
@software{bact_2019_3457447,
  author       = {Suriyawongkul, Arthit and
                  Chuangsuwanich, Ekapol and
                  Chormai, Pattarawat and
                  Polpanumas, Charin},
  title        = {PyThaiNLP/wisesight-sentiment: First release},
  month        = sep,
  year         = 2019,
  publisher    = {Zenodo},
  version      = {v1.0},
  doi          = {10.5281/zenodo.3457447},
  url          = {https://doi.org/10.5281/zenodo.3457447}
}

@lhoestq Thanks, Quentin. Removed the .ipynb_checkpoints and edited the README.md. The tests are failing because of other dataets. I'm figuring out why since the commits only have changes on wisesight_sentiment
FAILED tests/test_dataset_common.py::RemoteDatasetTest::test_builder_class_flue
FAILED tests/test_dataset_common.py::RemoteDatasetTest::test_builder_class_norwegian_ner
FAILED tests/test_dataset_common.py::RemoteDatasetTest::test_builder_configs_flue
FAILED tests/test_dataset_common.py::RemoteDatasetTest::test_builder_configs_norwegian_ner
FAILED tests/test_dataset_common.py::RemoteDatasetTest::test_load_dataset_flue
FAILED tests/test_dataset_common.py::RemoteDatasetTest::test_load_dataset_norwegian_ner
FAILED tests/test_dataset_common.py::RemoteDatasetTest::test_load_dataset_xglue

@cstorm125 I really like the dataset and dataset card but there seems to have been a rebase issue at some point since it's now changing 140 files :D
Could you rebase from master?

I think it might be faster to close and reopen.

To be continued on: https://github.com/huggingface/datasets/pull/981


text:
Error when running minhash

Have you ever seen this bug when running minhash? What might be the cause?
File "/output/datatrove/src/datatrove/pipeline/dedup/minhash.py", line 139, in read_sigs
File "/opt/conda/envs/datatrove/lib/python3.10/site-packages/multiprocess/pool.py", line 125, in worker
result = (True, func(*args, **kwds))
raise value
File "/output/datatrove/examples/minhash_deduplication_mp.py", line 157, in main
File "/output/datatrove/src/datatrove/pipeline/base.py", line 122, in __call__
Traceback (most recent call last):
File "/output/datatrove/src/datatrove/executor/base.py", line 77, in _run_for_rank
"""
File "/output/datatrove/src/datatrove/pipeline/dedup/minhash.py", line 378, in run
AssertionError: Hash order error. f.tell()=13504008, min_hash=167858917, sigdata=(62530469, 17634173, 42943397, 32616677, 9946320, 97645252, 33852496, 40487027, 13335797, 46577224, 99341049, 65232832, 98314078), last=(168841106, 1007538214, 22584412, 260559064, 494471935, 336374100, 632602342, 773108968, 87337671, 1064337302, 10811556, 112410251, 404805684)
File "/output/datatrove/src/datatrove/executor/local.py", line 112, in run
stats = list(
The above exception was the direct cause of the following exception:

I am facing the same issue, @jordane95 did you find the reason for this?

I am facing the same issue, @jordane95 did you find the reason for this?

Could you try to delete the log and rerun the job? I suppose that one hash was compute/stored incorrectly due to machine corruption.

I deleted the log and rerun 2 times. I looked at the signatures too, none of the signatures look 0 to me. But the error in stage 2 shows that the min_hash is 0.

I'm also running into a similar issue, when running with a large number of workers. What exactly could be the cause of this error?
The code in minhash.py seems to be relying on a bool flag ensure_order (True by default). I wonder what the implications of setting ensure_order=False would be.

Tagging @guipenedo since git blame shows him as the contributor to this function in #82.
Long story short, we are trying to run minhash deduplication on some large scale datasets (4TB and 8TB) and we are sporadically running into this error. For the 8TB dataset, we are consistently seeing this error at the bucketization stage:
0:     ensure_order is False or last is None or sigdata >= last
0: AssertionError: Hash order error. f.tell()=280, min_hash=644059, sigdata=(575424, 9907098, 11660665, 16233260, 21845025, 4116939, 677894, 25918161, 26999693, 1259831, 7481797, 3715207, 24229330), last=(779927, 2757959, 9287481, 6215803, 3588275, 4152628, 452551, 26101124, 5808549, 4675425, 17486690, 5048257, 9197709)

Our pipeline setup is fairly straightforward:
Stage 1 setup:
minhash_config = MinhashConfig(
    num_buckets=20,
    hashes_per_bucket=13,
    hash_config=HashConfig(precision=32),
)
    stage1 = SlurmPipelineExecutor(
        job_name=f"{EXPERIMENT_NAME}-dedup-stage-1",
        pipeline=[
            JsonlReader(INPUT_DATASET_PATH, text_key=INPUT_DATASET_KEY),
            MinhashDedupSignature(output_folder=STAGE_1_OUTPUT, config=minhash_config),
        ],
        tasks=NUM_TASKS_STAGE_1_COMPUTE_MINHASH,
        time="16:00:00",
        partition=PARTITION,
        logging_dir=STAGE_1_LOGS,
        slurm_logs_folder=f"{STAGE_1_LOGS}/slurm_logs",
        cpus_per_task=1,
        mem_per_cpu_gb=MEM_GB_STAGE_1_COMPUTE_MINHASH,
        max_array_launch_parallel=True,
        env_command=env_command
    )
    stage1.run()

Stage 2 setup:
    stage2 = SlurmPipelineExecutor(
        job_name=f"{EXPERIMENT_NAME}-dedup-stage-2",
        pipeline=[
            MinhashDedupBuckets(
                input_folder=STAGE_1_OUTPUT,
                output_folder=STAGE_2_OUTPUT,
                config=minhash_config,
            ),
        ],
        tasks=NUM_TASKS_STAGE_2_BUCKETIZE,
        time="16:00:00",
        partition=PARTITION,
        logging_dir=STAGE_2_LOGS,
        slurm_logs_folder=f"{STAGE_2_LOGS}/slurm_logs",
        cpus_per_task=1,
        mem_per_cpu_gb=MEM_GB_STAGE_2_BUCKETIZE,
        max_array_launch_parallel=True,
        env_command=env_command,
    )
    stage2.run()

Any pointers would be greatly appreciated.

Hi,
The first step (MinhashDedupSignature) will create files with sequences of hashes_per_bucket integers followed by the document id. These files will then be sorted, so that when we read from multiple files in the bucketing step, we can do a single pass through each file, by pulling the top element from each one and adding it to a priority queue. If these files are not sorted, then the single pass method will not work and you have the risk of missing multiple duplicates.
Typically this (the file not being sorted) happens when there was some network issue/corruption when sorting and saving the files. You absolutely do not want to turn ensure_order to False, as then you would be silently missing a lot of duplicates. The only solution here is to rerun the first step for the tasks that produced the corrupted/unordered files.
You can add file_stem to the assert error message so that you know which rank from step1 failed. Then you can delete that rank's completion file and rerun step1 (only the ranks you removed should run). I will consider adding a verification at the end of step1 to make sure the file is sorted before the task completes, so that this issue is caught directly during step1.

Thanks for your prompt response, I will try your suggestions.

A quick update on this issue:
After adding the file_stem value to the log, and attempting to re-run, we noticed that some files from stage 1 were indeed corrupt. This turned out to be caused by the worker running out of disk storage space :man_facepalming:
Those ranks had silently failed, which is why we didn't catch the issue after stage 1 finished.
After increasing the disk space and re-running stage 1, we stopped seeing the error at stage 2.
Thanks again for your help Guilherme!

Glad it's working now! Just to clarify, were the ranks that had failed marked as completed (did they have a file in completions)?

Sorry I'm not sure. I cleared out all the results before retrying a second time.

repo: huggingface/datatrove


text:
Fix AttributeError for wav2vec test

resolve runtime error for PYTEST- wav2vec test_model_for_pretraining

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

authors: HuggingFaceDocBuilderDev Jianhong-Zhang

repo: huggingface/optimum-habana


text:
RuntimeError: expected scalar type Float but found Half

This my code：
# 引入相应的包 Importing libraries

  peft_model_id= 'int8_peft_model'
  trainer.model.save_pretrained(peft_model_id)

if __name__ == "__main__":
  train_func_main()

I execute the following code in the command line：
python int8_peft_lora_PromptCLUE_Finetuning.py
Then the following error message appears:
  0%|                                                 | 0/35646 [00:00<?, ?it/s]You're using a T5TokenizerFast tokenizer. Please note that with a fast tokenizer, using the `__call__` method is faster than using a method to encode the text followed by a call to the `pad` method to get a padded encoding.
/root/anaconda3/lib/python3.9/site-packages/bitsandbytes/autograd/_functions.py:298: UserWarning: MatMul8bitLt: inputs will be cast from torch.float32 to float16 during quantization
  warnings.warn(f"MatMul8bitLt: inputs will be cast from {A.dtype} to float16 during quantization")
Traceback (most recent call last):
  File "/root/gaochangkuan_AI/PromptCLUE_Finetuning/int8_peft_lora_PromptCLUE_Finetuning.py", line 252, in <module>
    train_func_main()
  File "/root/gaochangkuan_AI/PromptCLUE_Finetuning/int8_peft_lora_PromptCLUE_Finetuning.py", line 247, in train_func_main
    trainer.train()
  File "/root/anaconda3/lib/python3.9/site-packages/transformers/trainer.py", line 1576, in train
    return inner_training_loop(
  File "/root/anaconda3/lib/python3.9/site-packages/transformers/trainer.py", line 1843, in _inner_training_loop
    tr_loss_step = self.training_step(model, inputs)
  File "/root/anaconda3/lib/python3.9/site-packages/transformers/trainer.py", line 2588, in training_step
    loss = self.compute_loss(model, inputs)
  File "/root/anaconda3/lib/python3.9/site-packages/transformers/trainer.py", line 2620, in compute_loss
    outputs = model(**inputs)
  File "/root/anaconda3/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1194, in _call_impl
    return forward_call(*input, **kwargs)
  File "/root/anaconda3/lib/python3.9/site-packages/peft/peft_model.py", line 639, in forward
    return self.base_model(
  File "/root/anaconda3/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1194, in _call_impl
    return forward_call(*input, **kwargs)
  File "/root/anaconda3/lib/python3.9/site-packages/accelerate/hooks.py", line 156, in new_forward
    output = old_forward(*args, **kwargs)
  File "/root/anaconda3/lib/python3.9/site-packages/transformers/models/t5/modeling_t5.py", line 1722, in forward
    lm_logits = self.lm_head(sequence_output)
  File "/root/anaconda3/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1194, in _call_impl
    return forward_call(*input, **kwargs)
  File "/root/gaochangkuan_AI/PromptCLUE_Finetuning/int8_peft_lora_PromptCLUE_Finetuning.py", line 175, in forward
    return super().forward(x).to(torch.float32)
  File "/root/anaconda3/lib/python3.9/site-packages/torch/nn/modules/container.py", line 204, in forward
    input = module(input)
  File "/root/anaconda3/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1194, in _call_impl
    return forward_call(*input, **kwargs)
  File "/root/anaconda3/lib/python3.9/site-packages/accelerate/hooks.py", line 156, in new_forward
    output = old_forward(*args, **kwargs)
  File "/root/anaconda3/lib/python3.9/site-packages/torch/nn/modules/linear.py", line 114, in forward
    return F.linear(input, self.weight, self.bias)
RuntimeError: expected scalar type Float but found Half
╭───────────────────── Traceback (most recent call last) ──────────────────────╮
│ /root/gaochangkuan_AI/PromptCLUE_Finetuning/int8_peft_lora_PromptCLUE_Finetu │
│ ning.py:252 in <module>                                                      │
│                                                                              │
│   249   trainer.model.save_pretrained(peft_model_id)                         │
│   250                                                                        │
│   251 if __name__ == "__main__":                                             │
│ ❱ 252   train_func_main()                                                    │
│   253                                                                        │
│                                                                              │
│ /root/gaochangkuan_AI/PromptCLUE_Finetuning/int8_peft_lora_PromptCLUE_Finetu │
│ ning.py:247 in train_func_main                                               │
│                                                                              │
│   244 │   │   │   │   │    data_collator= seq2seq_data_collator              │
│   245 │   │   │   │   │   )                                                  │
│   246   model.config.use_cache = False  # silence the warnings. Please re-en │
│ ❱ 247   trainer.train()                                                      │
│   248   peft_model_id= 'int8_peft_model'                                     │
│   249   trainer.model.save_pretrained(peft_model_id)                         │
│   250                                                                        │
│                                                                              │
│ /root/anaconda3/lib/python3.9/site-packages/transformers/trainer.py:1576 in  │
│ train                                                                        │
│                                                                              │
│   1573 │   │   inner_training_loop = find_executable_batch_size(             │
│   1574 │   │   │   self._inner_training_loop, self._train_batch_size, args.a │
│   1575 │   │   )                                                             │
│ ❱ 1576 │   │   return inner_training_loop(                                   │
│   1577 │   │   │   args=args,                                                │
│   1578 │   │   │   resume_from_checkpoint=resume_from_checkpoint,            │
│   1579 │   │   │   trial=trial,                                              │
│                                                                              │
│ /root/anaconda3/lib/python3.9/site-packages/transformers/trainer.py:1843 in  │
│ _inner_training_loop                                                         │
│                                                                              │
│   1840 │   │   │   │   │   with model.no_sync():                             │
│   1841 │   │   │   │   │   │   tr_loss_step = self.training_step(model, inpu │
│   1842 │   │   │   │   else:                                                 │
│ ❱ 1843 │   │   │   │   │   tr_loss_step = self.training_step(model, inputs)  │
│   1844 │   │   │   │                                                         │
│   1845 │   │   │   │   if (                                                  │
│   1846 │   │   │   │   │   args.logging_nan_inf_filter                       │
│                                                                              │
│ /root/anaconda3/lib/python3.9/site-packages/transformers/trainer.py:2588 in  │
│ training_step                                                                │
│                                                                              │
│   2585 │   │   │   return loss_mb.reduce_mean().detach().to(self.args.device │
│   2586 │   │                                                                 │
│   2587 │   │   with self.compute_loss_context_manager():                     │
│ ❱ 2588 │   │   │   loss = self.compute_loss(model, inputs)                   │
│   2589 │   │                                                                 │
│   2590 │   │   if self.args.n_gpu > 1:                                       │
│   2591 │   │   │   loss = loss.mean()  # mean() to average on multi-gpu para │
│                                                                              │
│ /root/anaconda3/lib/python3.9/site-packages/transformers/trainer.py:2620 in  │
│ compute_loss                                                                 │
│                                                                              │
│   2617 │   │   │   labels = inputs.pop("labels")                             │
│   2618 │   │   else:                                                         │
│   2619 │   │   │   labels = None                                             │
│ ❱ 2620 │   │   outputs = model(**inputs)                                     │
│   2621 │   │   # Save past state if it exists                                │
│   2622 │   │   # TODO: this needs to be fixed and made cleaner later.        │
│   2623 │   │   if self.args.past_index >= 0:                                 │
│                                                                              │
│ /root/anaconda3/lib/python3.9/site-packages/torch/nn/modules/module.py:1194  │
│ in _call_impl                                                                │
│                                                                              │
│   1191 │   │   # this function, and just call forward.                       │
│   1192 │   │   if not (self._backward_hooks or self._forward_hooks or self._ │
│   1193 │   │   │   │   or _global_forward_hooks or _global_forward_pre_hooks │
│ ❱ 1194 │   │   │   return forward_call(*input, **kwargs)                     │
│   1195 │   │   # Do not call functions when jit is used                      │
│   1196 │   │   full_backward_hooks, non_full_backward_hooks = [], []         │
│   1197 │   │   if self._backward_hooks or _global_backward_hooks:            │
│                                                                              │
│ /root/anaconda3/lib/python3.9/site-packages/peft/peft_model.py:639 in        │
│ forward                                                                      │
│                                                                              │
│   636 │   │   **kwargs,                                                      │
│   637 │   ):                                                                 │
│   638 │   │   if not isinstance(self.peft_config, PromptLearningConfig):     │
│ ❱ 639 │   │   │   return self.base_model(                                    │
│   640 │   │   │   │   input_ids=input_ids,                                   │
│   641 │   │   │   │   attention_mask=attention_mask,                         │
│   642 │   │   │   │   inputs_embeds=inputs_embeds,                           │
│                                                                              │
│ /root/anaconda3/lib/python3.9/site-packages/torch/nn/modules/module.py:1194  │
│ in _call_impl                                                                │
│                                                                              │
│   1191 │   │   # this function, and just call forward.                       │
│   1192 │   │   if not (self._backward_hooks or self._forward_hooks or self._ │
│   1193 │   │   │   │   or _global_forward_hooks or _global_forward_pre_hooks │
│ ❱ 1194 │   │   │   return forward_call(*input, **kwargs)                     │
│   1195 │   │   # Do not call functions when jit is used                      │
│   1196 │   │   full_backward_hooks, non_full_backward_hooks = [], []         │
│   1197 │   │   if self._backward_hooks or _global_backward_hooks:            │
│                                                                              │
│ /root/anaconda3/lib/python3.9/site-packages/accelerate/hooks.py:156 in       │
│ new_forward                                                                  │
│                                                                              │
│   153 │   │   │   with torch.no_grad():                                      │
│   154 │   │   │   │   output = old_forward(*args, **kwargs)                  │
│   155 │   │   else:                                                          │
│ ❱ 156 │   │   │   output = old_forward(*args, **kwargs)                      │
│   157 │   │   return module._hf_hook.post_forward(module, output)            │
│   158 │                                                                      │
│   159 │   module.forward = new_forward                                       │
│                                                                              │
│ /root/anaconda3/lib/python3.9/site-packages/transformers/models/t5/modeling_ │
│ t5.py:1722 in forward                                                        │
│                                                                              │
│   1719 │   │   │   # See https://github.com/tensorflow/mesh/blob/fa19d69eafc │
│   1720 │   │   │   sequence_output = sequence_output * (self.model_dim**-0.5 │
│   1721 │   │                                                                 │
│ ❱ 1722 │   │   lm_logits = self.lm_head(sequence_output)                     │
│   1723 │   │                                                                 │
│   1724 │   │   loss = None                                                   │
│   1725 │   │   if labels is not None:                                        │
│                                                                              │
│ /root/anaconda3/lib/python3.9/site-packages/torch/nn/modules/module.py:1194  │
│ in _call_impl                                                                │
│                                                                              │
│   1191 │   │   # this function, and just call forward.                       │
│   1192 │   │   if not (self._backward_hooks or self._forward_hooks or self._ │
│   1193 │   │   │   │   or _global_forward_hooks or _global_forward_pre_hooks │
│ ❱ 1194 │   │   │   return forward_call(*input, **kwargs)                     │
│   1195 │   │   # Do not call functions when jit is used                      │
│   1196 │   │   full_backward_hooks, non_full_backward_hooks = [], []         │
│   1197 │   │   if self._backward_hooks or _global_backward_hooks:            │
│                                                                              │
│ /root/gaochangkuan_AI/PromptCLUE_Finetuning/int8_peft_lora_PromptCLUE_Finetu │
│ ning.py:175 in forward                                                       │
│                                                                              │
│   172                                                                        │
│   173 class CastOutputToFloat(nn.Sequential):                                │
│   174   def forward(self, x):                                                │
│ ❱ 175 │   return super().forward(x).to(torch.float32)                        │
│   176                                                                        │
│   177 model.lm_head = CastOutputToFloat(model.lm_head)                       │
│   178                                                                        │
│                                                                              │
│ /root/anaconda3/lib/python3.9/site-packages/torch/nn/modules/container.py:20 │
│ 4 in forward                                                                 │
│                                                                              │
│   201 │   # with Any as TorchScript expects a more precise type              │
│   202 │   def forward(self, input):                                          │
│   203 │   │   for module in self:                                            │
│ ❱ 204 │   │   │   input = module(input)                                      │
│   205 │   │   return input                                                   │
│   206 │                                                                      │
│   207 │   def append(self, module: Module) -> 'Sequential':                  │
│                                                                              │
│ /root/anaconda3/lib/python3.9/site-packages/torch/nn/modules/module.py:1194  │
│ in _call_impl                                                                │
│                                                                              │
│   1191 │   │   # this function, and just call forward.                       │
│   1192 │   │   if not (self._backward_hooks or self._forward_hooks or self._ │
│   1193 │   │   │   │   or _global_forward_hooks or _global_forward_pre_hooks │
│ ❱ 1194 │   │   │   return forward_call(*input, **kwargs)                     │
│   1195 │   │   # Do not call functions when jit is used                      │
│   1196 │   │   full_backward_hooks, non_full_backward_hooks = [], []         │
│   1197 │   │   if self._backward_hooks or _global_backward_hooks:            │
│                                                                              │
│ /root/anaconda3/lib/python3.9/site-packages/accelerate/hooks.py:156 in       │
│ new_forward                                                                  │
│                                                                              │
│   153 │   │   │   with torch.no_grad():                                      │
│   154 │   │   │   │   output = old_forward(*args, **kwargs)                  │
│   155 │   │   else:                                                          │
│ ❱ 156 │   │   │   output = old_forward(*args, **kwargs)                      │
│   157 │   │   return module._hf_hook.post_forward(module, output)            │
│   158 │                                                                      │
│   159 │   module.forward = new_forward                                       │
│                                                                              │
│ /root/anaconda3/lib/python3.9/site-packages/torch/nn/modules/linear.py:114   │
│ in forward                                                                   │
│                                                                              │
│   111 │   │   │   init.uniform_(self.bias, -bound, bound)                    │
│   112 │                                                                      │
│   113 │   def forward(self, input: Tensor) -> Tensor:                        │
│ ❱ 114 │   │   return F.linear(input, self.weight, self.bias)                 │
│   115 │                                                                      │
│   116 │   def extra_repr(self) -> str:                                       │
│   117 │   │   return 'in_features={}, out_features={}, bias={}'.format(      │
╰──────────────────────────────────────────────────────────────────────────────╯
RuntimeError: expected scalar type Float but found Half

What is the reason for this, please?
Also, I am trying to enable the operations fp16, gradient_checkpointing, gradient_accumulation_steps at the same time, is there any conflict with this?

Hey, How did you solve this problem? Thank you.

Hey, How did you solve this problem? Thank you.

你好，你解决这个问题了吗？

repo: huggingface/peft


text:
Add seq2seq prompt tuning support

This commit adds prompt tuning and support for the generate method for encoder-decoders.
Using generate for encoder-decoder models with prompt tuning was previously not supported as you can't use generate with ìnputs_embeds. I address this issue by generating the encoder_outputs of the input_ids + prompt, and passing it to generate.
Also included two examples notebooks to showcase this feature.

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint.

@pacman100 I forgot to run make, this should be good with the latest commit

@pacman100 I have incorporated the changes discussed above, and the suggestions from @ZhengxiangShi, thanks a lot!
Regarding point 2 of the caveats, I don't think it is longer relevant, I took the liberty to remove it.

Thanks for your help! @thomas-schillaci @pacman100


text:
Adding links to Adyen blogpost.

What does this PR do?

Fixes # (issue)
Before submitting

[ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
[ ] Did you read the contributor guideline,
Pull Request section?
[ ] Was this discussed/approved via a Github issue or the forum? Please add a link
to it if that's the case.
[ ] Did you make sure to update the documentation with your changes? Here are the
documentation guidelines, and
here are tips on formatting docstrings.
[ ] Did you write any new necessary tests?

Who can review?
Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

authors: HuggingFaceDocBuilderDev Narsil

repo: huggingface/text-generation-inference