How do I use the modulus operator?

When using the % operator I am left with the error “Did you forget a , here?”. Is there another keyword for % in ReScript? Js.log(20 % 2) Note: This is a translation of this question for ReasonML. The modulo operator is a plain function called mod in ReScript. It can be used either with … Read more

csv remove rows where second column has less than X words

I have a large csv (35gb) of following format: “id”,”text”,”other_info” “1”,”this is some text, a news report citing more than 30 sources, including investors”,”some other info” “11”,”this is some text”,”sme other info” “111”,””,”sme other info” “21”,”this is some real text Language models with hundreds of billions of parameters”,”sme other info” Result: “id”,”text”,”other_info” “1”,”this is some … Read more

SwiftData Predicate ridiculous set-contains-check crash in Swift

It is so ridiculous, but I have a crash in this code: var fetchDescriptor = FetchDescriptor<FactModel>() fetchDescriptor.fetchLimit = 10 fetchDescriptor.sortBy = [.init(\.showCount, order: .forward)] let key = category.key if key != “general” { fetchDescriptor.predicate = #Predicate { fact in fact.categories.contains(key) } } let result = try modelContext.fetch(fetchDescriptor) The crash happens on the fetching when the … Read more

transformer model for Language Modelling in NLP

Purpose of the model The purpose of the model is to build a small scale LLM (No need to be that better as other LLMs) from scratch to understand the concepts of coding an LLM. Expected Working The model is just expected to produce meaningful generations (due to resource constraints). Problem The problem with this … Read more

How to add label if the PR’s code contains specific text?

We are using Labeler to have labels on the Pull Request depending on which file we are modifying. I’m searching for a similar tool, that should check the modified code lines for a specific text. Is there any tool like this available? So for instance, if I want to check for “@deprecated” in the modified … Read more

Pandas str.replace with regex doubles results? [duplicate]

This question already has answers here: re.sub(“.*”, “, “(replacement)”, “text”) doubles replacement on Python 3.7 (2 answers) Why do some regex engines match .* twice in a single input string? (1 answer) Closed yesterday. Let’s say I have this pandas Series: $ python3 -c ‘import pandas as pd; print(pd.Series([“1″,”2″,”3″,”4”]))’ 0 1 1 2 2 3 … Read more