function update_ollama_models
echo "Fetching list of Ollama models..."
set -l jobs
ollama list | tail -n +2 | while read -l line
set model_name (echo $line | awk '{print $1}')
if test -n "$model_name"
echo "Attempting to update model: $model_name"
ollama pull $model_name &
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
function update_ollama_models { | |
echo "Fetching list of Ollama models..." | |
jobs=() | |
ollama list | tail -n +2 | while read -r line; do | |
model_name=$(echo "$line" | awk '{print $1}') | |
if [[ -n "$model_name" ]]; then | |
echo "Attempting to update model: $model_name" | |
ollama pull "$model_name" & | |
jobs+=("$!") | |
echo "Started update for model: $model_name" |
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
function convert_and_move_dalle_images | |
# Parse the arguments | |
set delete_flag 0 | |
for arg in $argv | |
switch $arg | |
case '-d' '--delete' | |
set delete_flag 1 | |
end | |
end |
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
function update_pyproject_version | |
if test -f pyproject.toml | |
# Extract the current version | |
set current_version (awk -F '"' '/version =/ {print $2}' pyproject.toml) | |
# Break down the version into major, minor, and patch | |
set -l major (echo $current_version | cut -d'.' -f1) | |
set -l minor (echo $current_version | cut -d'.' -f2) | |
set -l patch (echo $current_version | cut -d'.' -f3) |
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
function format_aliases | |
# Define colors | |
set cyan (set_color cyan) | |
set yellow (set_color yellow) | |
set blue (set_color blue) | |
set reset_color (set_color normal) | |
# Find the longest alias name for alignment | |
set -l longest 0 | |
for line in (alias) |
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
function lobe_chat | |
# Check if Ollama serve is running on port 11434 | |
if not netstat -tuln | grep -q 11434 | |
echo "Starting Ollama serve..." | |
# Assuming ollama serve is the correct command to start the server | |
ollama serve & | |
else | |
echo "Ollama serve is already running." | |
end |
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 requests | |
import json | |
import base64 | |
import os | |
from typing import List | |
def get_keywords(image: str) -> List[str]: | |
body = { | |
"model": "llava-phi", |
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
"""If you mix up the order of letters in a word, many people can slitl raed and urenadnstd tehm. Write a function that takes an input sentence, and mixes up the insides of words (anything longer than 3 letters).""" | |
def scramble(sentence: str): | |
import random | |
import string | |
new_sentence = sentence.translate(str.maketrans('', '', string.punctuation)) | |
words = new_sentence.split() | |
scrambled = [] | |
for word in words: | |
if len(word) > 3: |