Skip to content

Instantly share code, notes, and snippets.

View Hansimov's full-sized avatar

Hansimov

View GitHub Profile
@Hansimov
Hansimov / enable-arc-770-in-ubuntu.md
Last active December 19, 2023 09:42
Enable using Intel Arc 770 GPU in Ubuntu

List GPUs in machine

sudo lshw -C display
  *-display UNCLAIMED
       description: VGA compatible controller
       product: GP102 [TITAN Xp]
@Hansimov
Hansimov / logger.py
Last active January 31, 2024 09:33
A script template of logger.py
import datetime
import functools
import inspect
import logging
import os
import shutil
import subprocess
from termcolor import colored
@Hansimov
Hansimov / install-docker.md
Last active January 5, 2024 18:34
Install and setup docker
@Hansimov
Hansimov / set-system-date-time-ubuntu.md
Last active January 31, 2024 09:34
Set system date time from internet in ubuntu
@Hansimov
Hansimov / sync-github-repo-to-huggingface-space.md
Last active April 15, 2024 22:11
Sync Github repo to Huggingface space

Push Github Repo to Huggingface Space

Create a huggingface token

Put it in the repo secrets with name like HF_TOKEN in related Github repo setitngs:

Run following commands in the git root folder:

@Hansimov
Hansimov / git-separate-folder-to-repo.md
Last active November 10, 2023 17:06
Separate subfolder in current Git repo to a new repo
  1. Create a new folder where would place the new repo
  2. git clone the original repo under this folder
  3. Download git-filter-repo from here: (Do not chagne its extension)
  4. cd the cloned repo root folder, and run following: python git-filter-repo --path <directory_to_separate_to_new_repo> --force
  5. Copy follwing files to root path of the new folder created in step 1:
    • Remaining files under <directory_to_separate_to_new_repo>
    • .git directory in original repo root folder
@Hansimov
Hansimov / xui-in-azure.md
Created October 5, 2023 15:47
Use Microsoft Azure to forward network traffic with X-UI
@Hansimov
Hansimov / speech_to_text.py
Last active August 13, 2023 14:16
Speech to Text with Whisper from OpenAI with Python
import torch
import whisper
from pathlib import Path
from termcolor import colored
class SpeechToTextConverter:
def __init__(self, folders=["."], exts=[".mp3"], files=None):
self.folders = folders
@Hansimov
Hansimov / install-pytorch-with-cuda.md
Last active August 13, 2023 07:56
Install PyTorch with CUDA enabled

Check if CUDA is available by torch:

import torch

def check_cuda():
    print(torch.version.cuda)
    cuda_is_ok = torch.cuda.is_available()
    print(f"CUDA Enabled: {cuda_is_ok}")
@Hansimov
Hansimov / linux-pacakges-and-envs.md
Last active July 8, 2023 14:47
Packages and envs for working use