GithubHelp home page GithubHelp logo

adamelliotfields / dotfiles Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 1.9 MB

Shell scripts 🐚

License: MIT License

Makefile 1.76% Shell 89.06% Vim Script 4.14% JavaScript 4.04% Python 0.99%
bash dotfiles fish shell

dotfiles's Introduction

dotfiles's People

Contributors

adamelliotfields avatar

Stargazers

 avatar

Watchers

 avatar

dotfiles's Issues

Refactor Git config setup

I didn't even know this was a thing until yesterday.

Similar to ~/.config/git/ignore, you can put additional "global" settings in ~/.config/git/config.

When you run git commands, it will automatically read this file in addition to ~/.gitconfig.

When you write to the config with --global, it will only write to ~/.config/git/config if ~/.gitconfig doesn't exist. This allows us to have "static" and "dynamic" configs. For example, switching your Git email can be in the dynamic config that isn't checked into version control.

Document functions

Need to update the main README to list the functions. The bash-snippets repo does this brilliantly.

Should also reword it to distinguish the provisioning scripts from the fun stuff.

Degit

Implement “degit” in Fish.

See Rich Harris’ degit, and Luke Edwards’ gittar.

Convert `chat.fish` to `hf.fish`

Needs additional flags for text-to-image task. Similar to your 🤗 worker.

Ensure binary responses (e.g., text-to-image, text-to-speech) are saved and not dumped to terminal (use curl -o).

Delete existing hf alias (never used). Update README and gif.

Use aichat for chat endpoints; this will just be to interact with models directly.

Default model is HuggingFaceH4/zephyr-7b-beta.

Examples

hf Once upon a time,

hf --model=stabilityai/stable-diffusion-xl-base-1.0 --size=512,512 --negative_prompt=bowtie --out=cat.jpg An adorable tuxedo kitten.

hf -m facebook/mms-tts-eng -o hal.flac "I'm sorry Dave. I'm afraid I can't do that."

Edit: Just make a separate hf.fish; also this should be in the new fish repo.

Add GPT bot Fish function

While looking into adding a cheat.sh function, I realized it would be perfect for the GPT 3.5 Turbo API.

Requirements

  • Get one-off completions
  • Support chats (persistence)
  • Be able to modify the system prompt
  • Change temperature, presence penalty, and frequency penalty
  • Set max tokens
  • Wrap text to specified length

For persistence use JSON files as this will allow you to seed the chat (i.e., few-shot learning) and enter system messages.

Notes

I could not get streaming to work. I think the issue might be because of buffering in jq, as the output gets printed almost all at once. I ended up making sick loading spinners so I'm not even concerned about the streaming anymore. There's always the website.

For reference, the API response looks like this:

curl https://api.openai.com/v1/chat/completions \
-fsSLH "Authorization: Bearer $OPENAI_API_KEY" \
--json '{
  "model": "gpt-3.5-turbo",
  "messages": [{ "role": "user", "content": "Can you explain the principle of conservation of energy?" }]
}'
{
  "id": "chatcmpl-42",
  "object": "chat.completion",
  "created": 1682920793,
  "model": "gpt-3.5-turbo-0301",
  "usage": {
    "prompt_tokens": 18,
    "completion_tokens": 116,
    "total_tokens": 134
  },
  "choices": [
    {
      "message": {
        "role": "assistant",
        "content": "The principle of conservation of energy states that energy cannot be created or destroyed, but it can be transformed from one form to another. This means that the total amount of energy in a closed system remains constant over time. Energy can be transferred from one object to another or converted from one form to another, such as from potential energy to kinetic energy. This principle is fundamental to many physical processes and plays a critical role in fields such as physics, engineering, and chemistry. Understanding the principle of conservation of energy allows us to better understand and predict the behavior of systems in the natural world."
      },
      "finish_reason": "stop",
      "index": 0
    }
  ]
}

Demo

Image

Remove Fisher dependencies

jorgebucaran/humantime.fish@main
jorgebucaran/autopair.fish@main
jorgebucaran/replay.fish@main
jorgebucaran/getopts.fish@main

Keeping autopair and replay.

getopts can be replaced by Fish's built-in argparse.

humantime is a tiny function.

Doesn't work when root

Sometimes you have to be root (RunPod, for example). Any sudo calls need to be removed (use a helper). For the install script, maybe add a message like "dotfiles: Don't run as root". Finally, create a lib function to create a new user (with a home folder, without a password, with passwordless sudo).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.