[英]Transformers tokenizer attention mask for pytorch
在我的代碼中我有:output = self.decoder(output, embedded, tgt_mask=attention_mask) 在哪里decoder_layer = TransformerDecoderLayer(embedding_size, num_heads, hidde ...
[英]Transformers tokenizer attention mask for pytorch
在我的代碼中我有:output = self.decoder(output, embedded, tgt_mask=attention_mask) 在哪里decoder_layer = TransformerDecoderLayer(embedding_size, num_heads, hidde ...
[英]Fine-tuning a pre-trained LLM for question-answering
客觀的我的目標是在有關曼聯 (MU) 2021/22 賽季(他們的賽季表現不佳)的數據集上微調預訓練的 LLM。 我希望能夠向經過微調的 model 提示諸如“MU 如何改進?”或“MU 最大的弱點是什么?”等問題。 理想的回應是有洞察力/邏輯和+100字數據我將簡單地使用相關維基頁面中的文本作為我 ...
[英]cannot import name 'PartialState' from 'accelerate' when using Huggingface pipeline on Kaggle notebook?
在 Kaggle 筆記本上從 Huggingface 導入管道時, 它拋出這個錯誤: 我該如何解決這個錯誤? ...
[英]How to deal with DataCollator and DataLoaders in Huggingface?
我在組合 DataLoader 和 DataCollator 時遇到問題。 以下帶有 DataCollatorWithPadding 的代碼會導致ValueError: Unable to create tensor, you should probably activate truncation ...
[英]How can i get pooled output from deberta model?
任何人都可以告訴我如何從 deberta model 匯集 output 嗎? 任何人都可以告訴我如何從 deberta model 匯集 output 嗎? 我想在不使用 *DebertaForSequenceClassification * 的情況下將它從DebertaModel用於我的分類 ...
[英]How to pass 2D attention mask to HuggingFace BertModel?
我想將定向注意力掩碼傳遞給BertModel.forward ,以便我可以控制每個標記在自我注意期間可以看到哪些周圍標記。 該矩陣必須是二維的。 這是一個包含三個輸入 ID 的示例,其中前兩個標記無法關注最后一個。 但是最后一個可以處理所有令牌。torch.tensor([ [1, 1, 1] ...
[英]Unable to connect to SQL Server with Kerberos when transformers library is installed
我正在嘗試使用 Python 中的 Kerberos 身份驗證連接到 mssql 數據庫。當我的 anaconda 環境剛剛安裝了 pyodbc 時,我可以連接並向數據庫發送查詢。 但是當我將 huggingface 的 transformer 庫添加到環境中時,出現以下錯誤: Error: ('H ...
[英]SetFit Model training on a custom dataset
我有一個 dataframe 有 3 列,我正在嘗試使用 SetFit model 執行一些鏡頭文本分類 Dataframe (df) 傳統的 SetFit model 接受兩個輸入即文本和 label 我想用額外的輸入來訓練 model,即 2 個輸入 (A,B) 來預測 label (C)。 而 ...
[英]tokenizer.save_pretrained TypeError: Object of type property is not JSON serializable
我正在嘗試按如下方式保存 GPT2 分詞器: 我收到以下錯誤:TypeError: Object of type property is not JSON serializable 更多細節: 我該如何解決這個問題? ...
[英]TypeError: '<' not supported between instances of 'torch.device' and 'int'
這是我從項目中安裝 requirement.txt 文件后收到的錯誤消息。 我認為它與火炬有關,但也不知道如何修復。 剛接觸抱臉變形,不知道是不是版本問題。 ...
[英]Getting an embedded output from huggingface transformers
為了比較不同的段落,我嘗試使用轉換器 model,將每個段落擬合到 model 上,最后我打算比較輸出並查看哪個段落最相似。 為此,我使用的是 Roberta-base model。我首先在一個段落上使用了 roberta tokenizer。 然后我在那個標記化的 output 上使用了 rob ...
[英]How to store the result of a huggingface pipeline as correct JSON?
我有一個 huggingface 管道,可以對標記進行分類,如下所示: 問題是由此產生的假定 json 是非常有問題的,它有單引號和類似的東西。 “數據”,即管道的 output,是一個包含字典的列表列表。 一個列表看起來像這樣,為了從 for 循環中存儲它們,我使用 sents 列表到 app ...
[英]Python - How to run a huggingface pipeline offline for the first time?
我有一個使用 Huggingface 管道的 python 代碼。 此代碼在可以不受限制地訪問 inte.net 的計算機上運行良好。 在第一次運行期間,此代碼下載轉換器並可能緩存它。 在隨后的運行中,它不再下載文件。 但我的問題是我需要讓這個程序在沒有 inte.net 連接的受限服務器環境中運 ...
[英]txtai.database.sql.base.SQLError: no such function: json_extract
使用 TxtAI python 模塊和 sql 查詢SELECT id, text, score, solution_id, column_name FROM txtai WHERE similar('{query}') AND score >= 0.5 ,我看到這個錯誤txtai.data ...
[英]Group JSON in order for it to be more readable
我有這個文件( MYFILE.txt ),它是包含字典的列表列表的 output: 我想將“文字”分組以僅獲取文本,而將隱喻保留原樣。 我嘗試使用下面的代碼,但它說string indices must be integers ,而且我還認為我可以將它設為 HTML 並為其着色以更好地顯示結果,但我 ...
[英]Flan T5 - How to give the correct prompt/question?
為 Flan T5 語言 model 提供正確類型的提示,以便為聊天機器人/選項匹配用例獲得正確/准確的響應。 我正在嘗試使用 Flan T5 model 來完成以下任務。 給定一個向用戶顯示選項列表的聊天機器人,model 必須進行語義選項匹配。 例如,如果選項是“烤雞、煙熏三文魚”,如果用戶說 ...
[英]"Unsupported number of image dimensions" while using image_utils from Transformers
我正在嘗試遵循這個 HuggingFace 教程https://huggingface.co/blog/fine-tune-vit 使用他們的“beans”數據集一切正常,但如果我將自己的數據集與我自己的圖像一起使用,我會遇到“不支持的圖像尺寸數”。 我想知道這里是否有人會提供有關如何調試它的指示 ...
[英]Getting "Unable to load weights from pytorch checkpoint file" when loading model from transformers
嘗試加載 model 時:from transformers import TrOCRProcessor,VisionEncoderDecoderModel model=VisionEncoderDecoderModel.from_pretrained('microsoft/trocr-base ...
[英]Error 'img' when applying increment with keras and transformers for image classification
我想應用 VIT 進行圖像分類。 但我有一個問題,我不知道如何解決它。 我的錯誤是這個“KeyError:'img'”。 當我應用最后一個命令時顯示錯誤,我不知道我的錯誤在哪里。 數據集中的圖像是 in.png,但我不認為這是錯誤的。 下面是腳本: ...
[英]BERT model convertation from DeepPavlov to HuggingFace format
我有一個包含 ruBERT model 的文件夾,它使用 Deeppavlov 庫的應用程序進行了微調。 該文件夾包含以下 model 個文件: 我如何將它轉換為 Huggingface 格式以便我可以以這種方式加載它? ...