Discover gists
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
collection_name = "paper_abstracts" | |
if collection_name in db_client.list_collections(): | |
db_client.delete_collection(name=collection_name) | |
print('Dropped existing collection to remake') | |
abstract_collection = db_client.create_collection( | |
name=collection_name, | |
# define the distance metric to use when comparing vectors in this collection | |
metadata={"hnsw:space": "cosine"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Redirects users back to the previous page when accessing a restricted LearnDash lesson | |
* | |
* @param string $redirect_url The redirect URL | |
* @param int $post_id The post ID | |
* @return string The modified redirect URL | |
*/ | |
function my_learndash_redirect( $redirect_url, $post_id ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<fileSnapshot xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | |
<files> | |
<file path="C:\ProgramData\chocolatey\lib\ChocolateyExplorer\ChocolateyExplorer.nupkg" checksum="47420CB8EDD6D423A15E0F193CAAE544" /> | |
<file path="C:\ProgramData\chocolatey\lib\ChocolateyExplorer\chocolateyexplorer.nuspec" checksum="FCCBF8F9821FA1BF22F991DD0A6E1AA5" /> | |
<file path="C:\ProgramData\chocolatey\lib\ChocolateyExplorer\tools\chocolateyInstall.ps1" checksum="7DC6F6DFA57A368C4A2C60811428C37D" /> | |
</files> | |
</fileSnapshot> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
db_client = chromadb.PersistentClient(path="chroma_db") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import re | |
import shutil | |
from datetime import datetime | |
import chardet | |
def convert_file_encoding(file_path: str, backup: bool = True) -> bool: | |
""" | |
Конвертирует файл из cp1251 в utf-8 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<fileSnapshot xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | |
<files> | |
<file path="C:\ProgramData\chocolatey\lib\windv\WinDV-1.2.3.zip.txt" checksum="3DD4CDE41487E3F758C9BE646A8B587D" /> | |
<file path="C:\ProgramData\chocolatey\lib\windv\windv.nupkg" checksum="557B872A61A24F294370D72D1D7B0217" /> | |
<file path="C:\ProgramData\chocolatey\lib\windv\windv.nuspec" checksum="EF6BD4FBD8A72FC5ED346FA4F1598B8C" /> | |
<file path="C:\ProgramData\chocolatey\lib\windv\tools\chocolateyinstall.ps1" checksum="58E9DE77EBCEB99DE1A653D22F4272E9" /> | |
<file path="C:\ProgramData\chocolatey\lib\windv\tools\chocolateyuninstall.ps1" checksum="78BF0383802E9662268CFD2CCC2219E2" /> | |
<file path="C:\ProgramData\chocolatey\lib\windv\tools\Readme.txt" checksum="6C45DE16DEAFF75A06FC07DFB7C813ED" /> | |
<file path="C:\ProgramData\chocolatey\lib\windv\tools\WinDV.exe" checksum="311A5012BEFA3221243A4C3C8B6F6DBA" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"metrics": { | |
"_api_": { | |
"contains": "default", | |
"type": "trend", | |
"values": { | |
"avg": 3515.3106153, | |
"max": 5998.287294, | |
"med": 3708.5206390000003, | |
"min": 465.955339, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Log uploaded on Tuesday, February 11, 2025, 2:20:57 PM | |
Loaded mods: | |
Prepatcher(zetrith.prepatcher): 0Harmony(2.3.3), 0PrepatcherAPI(1.2.0), 0PrepatcherDataAssembly(1.0.0), PrepatcherImpl(1.0.0), Prestarter(1.0.0) | |
Harmony(brrainz.harmony)[mv:2.3.1.0]: 0Harmony(2.3.3), HarmonyMod(2.3.1) | |
Core(Ludeon.RimWorld): (no assemblies) | |
HugsLib(UnlimitedHugs.HugsLib)[ov:11.0.4]: 0Harmony(av:2.3.3,fv:1.2.0.1), HugsLib(av:1.0.0,fv:11.0.4) | |
Achtung!(brrainz.achtung)[mv:3.9.5.0]: Achtung(3.9.5), CrossPromotion(1.1.2), ModFeatures(1.2.6) | |
Allow Tool(UnlimitedHugs.AllowTool): AllowTool(av:3.6.0,fv:3.13.1) | |
Beautiful Outdoors(Meltup.BeautifulOutdoors): (no assemblies) | |
BetterInfoCard(Creeper.BetterInfoCard): BetterInfoCard(1.0.0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def brute_force_search(user_liked_paper, data_df, num_results=5): | |
start_time = time.time() | |
data_df['similarity'] = data_df['embedding'].apply( | |
lambda x: cosine_similarity([user_liked_paper['embedding']], [x])[0][0] | |
) | |
# Make sure the results don't contain the same paper as the query | |
search_results = data_df[data_df['doi'] != user_liked_paper['doi']].sort_values( | |
by='similarity', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Pipeline still running ... | |
PipelineRun is still running: Tasks Completed: 3 (Failed: 1, Cancelled 0), Incomplete: 3, Skipped: 48 | |
[get-pr-number : parse-pr-url] + echo -n 5939 | |
[get-pr-number : parse-pr-url] + tee /tekton/results/git_pr_number | |
[get-pr-number : parse-pr-url] 5939 | |
[acquire-lease : create-lease] + calculate_duration_in_seconds 90m | |
[acquire-lease : create-lease] + '[' m == m ']' | |
[acquire-lease : create-lease] + TOTAL_DURATION_IN_SECONDS=5400 | |
[acquire-lease : create-lease] + export TOTAL_DURATION_IN_SECONDS |