This file contains hidden or 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
(defun run-ask-ollama () | |
(interactive) | |
(let ((background (buffer-string)) | |
(question (read-from-minibuffer "What's your question? ")) | |
(buff (get-buffer-create "ollama"))) | |
(start-process "ollama" buff "ask_ollama.py" "-e" "http://127.0.0.1:11434" "-m" "deepseek-r1:14b" "-fi" question) | |
(process-send-string "ollama" background) | |
(process-send-eof "ollama") | |
(switch-to-buffer buff))) |
This file contains hidden or 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
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
''' | |
@date: 2024-07-22 | |
@author: Shell.Xu | |
@copyright: 2024, Shell.Xu <[email protected]> | |
@license: BSD-3-clause | |
''' | |
import sys | |
import argparse |
This file contains hidden or 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 json | |
import time | |
import hashlib | |
import requests | |
def sha256sum(s): | |
h = hashlib.sha256() | |
h.update(s.encode('utf-8')) |